嵌套 属性 where 子句与 Sails.js 1.0 不再工作

Nested property where clause with Sails.js 1.0 not working anymore

我刚刚升级到 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 by nested.property: nested.property is not a valid name for an attribute in Waterline. Even though this model (model) declares schema: 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.

Source

我最终使用了支持点符号的 mquery(例如 nested.property)。