排序更新或创建包含的关联

时间:2019-03-04 15:10:06

标签: javascript postgresql orm sequelize.js

具有 var children = grdDynamic.Children.ToList(); foreach (var child in children.Where(child => Grid.GetRow(child) == row)) { grdDynamic.Children.Remove(child); } 个关联的:

hasOne

和用户实例已经存在。我们如何添加新的const User = sequelize.define('user', {/* ... */}) const Project = sequelize.define('project', {/* ... */}) // One-way association User.hasOne(Project) 并将其连接到Project实例?

首先,我们需要找到User

User

接下来我们要做什么?如果const user = await models.users.findOne({ where: { id: 1 }, include: models.projects }); user.project怎么办?

1 个答案:

答案 0 :(得分:0)