我有一个模型answerlist
,其中有ownerId
和answeredBy
个对象,其中包含ownerId
。
我想在answerlist
处获取ownerId = answeredBy.ownerId
的数据。
不知道该如何续作。
以下是我的代码
db.answersList.findAll({
include: [
{ model: db.Employee, as: 'answeredBy', attributes: ['id', 'ownerId']},
{ model: db.Owner, as: 'owner',attributes: ['id']}
],
want to do something like where:{'answeredBy.ownerId':'owner.id'}
});