it seems like i can't display an array for my namespace
{{#each reports}}
{{_id}}
{{/each}}
my code looks like this
server method.
reports : function(){
var pipeline = [
{$group:{_id: "$activity.destination.name","count":{$sum:1 } } },
{$match:{_id:{$ne:null} }}];
var result = Reports.aggregate(pipeline);
console.log(result);
return result;
from helper
reports: function(){
Meteor.call("reports",function(err, data) {
arr =[];
data.forEach(function(doc){
arr.push(doc);
});
console.log(arr);
return arr;
});
}
in the browser console, the response looks like this
[Object]
0:Object
_id: "Balance Sheet and P&L Rates - Current Year"
count: 2 ..etc
im not sure if its the namespace or its an object array of non-cursors. but it doesn't give me an error. im not sure if what im doing is correct.