mongodb - How do I return only unique collection fields from a Meteor collection? -


i have simple to-do app users enter to-do , tag submit. when click tag on left side, displays to-do associated it. filter list on left side unique tags. can't seem find anywhere. help?

http://i.imgur.com/qcv6jmr.png

http://i.imgur.com/vq0akip.png

this works:

template.all.helpers({     linklist: function() {     var = *yourcollection*.find().fetch();      var *youruniquefielditems* = _.pluck(everything,"*yourfield*");       return _.uniq(*youruniquefielditems*);     }, 

the top voted answer here: meteor: how search distinct field values aka collection.distinct("fieldname") similar mongo's doesn't work, author of post found solution himself. unfortunately, it's buried in comments , it's not actual answer.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -