【问题标题】:Using waterline advanced queries via io.socket通过 io.socket 使用水线高级查询
【发布时间】:2015-03-19 20:53:29
【问题描述】:

我正在尝试获取适合特定日期时间范围的基础 mongodb 集合的子集。所以这里是一个代码:

io.socket.get('/myResource', {
    sort: 'myDatetimeField',
    where: {
        myDatetimeField: {
            '>': '2015-01-01T00:00:00.000Z',
            '<': '2015-02-01T00:00:00.000Z'
        }
    }
}, function() { ... });

结果是:

MongoError: Can't canonicalize query: BadValue Can't have RegEx as arg to predicate over field 'myDatetimeField'

是我遗漏了什么还是有什么问题?

附:在 mongo 2.6.8 中使用sails 0.11.0。

【问题讨论】:

    标签: sails.js waterline sails-mongo


    【解决方案1】:

    这似乎确实是一个问题(https://github.com/balderdashy/sails-mongo/issues/177),并且已经在 master 分支中修复了。

    【讨论】:

      猜你喜欢
      • 2015-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多