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

ε祈祈猫儿з 提交于 2019-12-25 02:47:06

问题


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


来源:https://stackoverflow.com/questions/24346489/how-to-use-min-mongo-query-in-meteor-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!