Meteor: how to search for only distinct field values aka a collection.distinct(“fieldname”) similar to Mongo's

后端 未结 4 1043
灰色年华
灰色年华 2020-12-01 08:04

I\'m using Meteor, and I\'m trying to find only distinct (unique) values of a field. Mongodb has the command

Collection.distinct(\"fieldname\");
         


        
4条回答
  •  伪装坚强ぢ
    2020-12-01 08:35

    If you'd prefer to do this on the server and thus save client memory and bandwidth try this aggregator package. It wraps mongodb's "distinct" function. https://github.com/zvictor/meteor-mongo-server/

提交回复
热议问题