1
はMongoDBのシェルで、私の入力と出力されます:ここで
meteor:PRIMARY> db.users.count({"profile.score": {$gt: 50}})
2
は私のコードです:ここでは
var allUsers = Meteor.users.find();
var newCurrentRank = allUsers.count({"profile.score": {$gt: 50}});
console.log("newCurrentRank", newCurrentRank);
は私のコンソールです:
I20161004-11:43:42.910(0)? newCurrentRank 12
:あなたが必要なもの
は、クエリオブジェクトに
find()
カーソルを呼び出し、count()
メソッドを呼び出すことです。 – webmagnets