Actually I want to aggregate based on username and contain place information. It is working fine with the mongo shell
db.demo_datas.aggregate([{"$group":{"_id":"$user_screenname", "place":{"$push":{"place":"$user_geo"}}}}]);
{
"_id" : "orena001",
"place" : [
{
"place" : [
11.158983,
78.163335
]
},
{
"place" : [
11.137964,
78.16126
]
}
]
}
Now, when i used with node.js mongoose the place array is not returning the values. The mongoose node.js query is
demodatas.aggregate([{$group:{"_id":"$user_screenname", "place":{"$push":{"place":"$user_geo"}}}}], function(err, data){
console.log(data);
});
but it returns result like this.
{ _id: 'orena001',
place:
[ [Object],
[Object]
]
}
could any one help me to resolve this issues. Thanks advance.