-->

How to use $min mongo query in Meteor.js?

2019-09-06 21:27发布

问题:

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}}]);

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?

回答1:

The standard Mongo query for that would use $gt:

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