【发布时间】:2016-09-19 17:34:17
【问题描述】:
是否可以在 Morphia 中使用 $where 条件?我没有在文档中看到它。这是我想要做的:
db.products.find({$where: 'this.items.length > 0'}, {product_id:1})
'items' 是一个集合,我想返回所有具有计数大于零的 items 集合的产品。
【问题讨论】:
是否可以在 Morphia 中使用 $where 条件?我没有在文档中看到它。这是我想要做的:
db.products.find({$where: 'this.items.length > 0'}, {product_id:1})
'items' 是一个集合,我想返回所有具有计数大于零的 items 集合的产品。
【问题讨论】:
您可以为此使用Query.where()。
【讨论】: