【发布时间】:2017-01-17 10:59:17
【问题描述】:
经过一些研究,我没有发现任何与我的问题有关的东西。所以设置是一个 M:M 关系已经与 sequelize (sqllite) 一起工作:
return User.find({ where: { _id: userId } }).then(user => {
logger.info(`UserController - found user`);
Notification.find({ where: { _id: notificationId } }).then(notification => {
if (associate) {
return user.addNotification([notification]);
} else {
return user.removeNotification([notification]);
}
})
})
问题是我在 inter table(cityId, active) 中有额外的字段,我不知道在运行“addNotification”时如何更新它。
提前致谢
【问题讨论】:
标签: node.js sequelize.js