Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的协会是
Member.hasMany(models.Event); Event.belongsTo(models.Member);
我需要对事件模型的查询来检索与事件关联的成员数据。
models.Event.findAll() // I need Member associated with each Event.
当我查询明细表时,有点像检索主人
需要这样做
Event.findAll({ include: [{ model: Member }] })
阅读文档:http ://docs.sequelizejs.com/en/latest/docs/querying/