我刚刚升级到 Sails.js 1.0,我的装饰器模式停止工作。
这就是我所拥有的:
let model = Model.find()
model
.where({
'nested.property': {
'>': 1
}
})
model.exec()
给我:
Could not use the provided
where
clause. Could not filter bynested.property
:nested.property
is not a valid name for an attribute in Waterline. Even though this model (model
) declaresschema: false
, this is not allowed.
我的数据库是 MongoDB。
最佳答案
这是一个未记录的功能,不再起作用。完整引用如下:
it looks like you were relying on some undocumented features of Waterline that just happened to work in previous versions; namely using native Mongo query syntax within a Waterline query. In 1.0, you'll need to use the lower-level datastore functionality.
我最终使用了mquery它支持点表示法(例如 nested.property
)。
关于javascript - Sails.js 1.0 的嵌套属性 where 子句不再起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44737352/