【问题标题】:GoInstant: Match a single array element with $goQuery?GoInstant:将单个数组元素与 $goQuery 匹配?
【发布时间】:2014-06-27 04:34:04
【问题描述】:

是否可以使用 GoInstant GoAngular 通过单个数组元素查询具有数组值的键?例如,如果查询具有以下键/属性的项目列表,我可以只选择属于单个用户的项目吗?

item: {
    name: 'Item name',
    description: 'A longer description of the item and its details',
    category: 'Business',
    user_ids: [1,3,7,15]  //This is an array of user id's because items
                          //have a many-to-many relationship with users
}

我尝试了这个查询,但它没有返回任何内容:

var queryResults = $goQuery('items', { user_ids: 1 }, { limit: 10 }).$sync();

我相信这是根据MongoDB documentation 的正确语法,但我不确定 GoInstant 是否已经实现了这个运算符。任何帮助将不胜感激。

【问题讨论】:

    标签: goinstant goangular


    【解决方案1】:

    这应该可以正常工作,这绝对是一个错误!请继续关注,一旦修复,我将更新此答案。

    【讨论】:

      猜你喜欢
      • 2019-01-05
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多