📜  续集排除属性 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:21.650000             🧑  作者: Mango

代码示例3
const my_model = await MyModel.findById(id, {
  include: [
    {
      model: AnotherModel,
      attributes: [ 'displayName', 'email' ] // only these attributes returned
    },
    { model: YetAnotherModel,
      include: [{
        model: AnotherModel,
        attributes: [ 'id', 'displayName', 'email' ]
      }]
    }
  ]
})