【问题标题】:Using javascript queries in Morphia在 Morphia 中使用 javascript 查询
【发布时间】:2016-09-19 17:34:17
【问题描述】:

是否可以在 Morphia 中使用 $where 条件?我没有在文档中看到它。这是我想要做的:

db.products.find({$where: 'this.items.length > 0'}, {product_id:1})

'items' 是一个集合,我想返回所有具有计数大于零的 items 集合的产品。

【问题讨论】:

    标签: mongodb morphia


    【解决方案1】:

    您可以为此使用Query.where()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多