如何在Meteor.js中使用$ min mongo查询? [英] How to use $min mongo query in Meteor.js?

查看:83
本文介绍了如何在Meteor.js中使用$ min mongo查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是在尝试创建一个过滤器,该过滤器仅显示具有多个帖子的帐户.

I'm basically trying to create a filter that only displays accounts that have more than one post.

return tags.find([{owner: this.userId, count: { $min: 1}}]);

它最终不返回任何内容.我也尝试使用.min()和其他东西.我相信它是标准的Mongo查询,并且想知道是否存在与流星有关的问题吗?

It ends up returning nothing. I tried using .min() and other stuff as well. I believe its a standard Mongo query and am wondering if there is a Meteor-specific issue?

推荐答案

对此的标准Mongo查询将使用

The standard Mongo query for that would use $gt:

tags.find({owner: this.userId, count: {$gt: 1}});

这篇关于如何在Meteor.js中使用$ min mongo查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆