我有这段代码可以查询我的反馈模型下的所有数据
const result = await models.Feedback.findOne({
include: [{
association: models.Feedback.Point,
order: [["date_saved", "DESC"]],
// where: { version_id: { [Op.not]: null } },
include: [{
association: models.Point.Creator
}, {
association: models.Point.User,
}, {
association: models.Point.Comment,
}]
}, {
association: models.Feedback.Project,
where: { subscription_id: currentUser.subscription_id }
}, {
association: models.Feedback.User,
include: [{
association: models.ProjectTeam.User
}]
}],
where: { id },
});
console.log(result.get({plain:true})'
Run Code Online (Sandbox Code Playgroud)
它给了我一个错误result.get is not a function。我不知道为什么我不能使用 get 函数。但从我的其他查询中,我可以使用 get 函数。我不知道为什么这段代码给我一个错误。
编辑:
结果的值为
ep_tblfeedback {
dataValues:
{ id: 239,
proj_id: …Run Code Online (Sandbox Code Playgroud)