知道如何在 sequelize 中使用带属性的包含(当您只需要包含包含表的特定字段时)?
目前我有这个(但它没有按预期工作):
var attributes = ['id', 'name', 'bar.version', ['bar.last_modified', 'changed']];
foo.findAll({
where : where,
attributes : attributes,
include : [bar]
}).success(function (result) { ...
最佳答案
这样的东西应该可以工作
foo.findAll({
where : where,
attributes : attributes,
include : [{ model: bar, attributes: attributes}]
}).success(function (result) {
关于node.js - 如何使用带有属性的包含与 Sequelize ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21883484/