Hi, I need someone help to solve my problem. I have create some code using meteorhacks but i still cannot display the result. Can someone help me. This I sharing my code:
//publish
Meteor.publish("profil", function() { var groupedKategori = Profil.aggregate({ $group: { _id: "$kategori", count:{$sum:1}}}); groupedKategori.forEach(function(kategori) { console.log(kategori); }); });
//html
` {{#each groupedKategori}}
//js
Template.laporankategori.helpers({ groupedKategori: function() { var currentUserId =this._id; return Profil.find({kategori: currentUserId}); }, });