I am using aggregate in node.js as follows
collection.aggregate(
{
$group : {
_id : "$id_page",
"count" : {$sum : 1}
}
},
{$sort : {"count" : -1}},
{$limit : 1}
).limit(1).toArray(function (err, r) { ................. })
this runs correctly but I am getting this result
{ id: '346593403645', _id: 57a868497e07fcf75f27009c, __v: 0 }
because of the _id
key, the object cannot be exploited.
Is it possible to use aggregate such a way it does not return the _id
key?