Sequelize中需要帮助的内容包括:
User.findAll({
where:
{ type: 'member'}
},
include: [
{ model: Cat },
required: false
]
}).then(users => console.log(users)).catch(err => console.log(err));
执行并返回
[{id:1, name:'A', cats: [{...},{...}],
{id:2, name:'B', cats: [{...},{...}],
{id:3, name:'C', cats: []}
我的问题是如何只返回没有猫的父母数据? 回报应该是这样的
[{id:3, name:'C', cats: []}