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

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

java - Reading data from multiple zip files and combining them to one -