mongodb uniq values
// Count uniq values
pipeline = [
{ $group: { _id: "$internalId"} },
{ $group: { _id: 1, count: { $sum: 1 } } }
];
//
// Run the aggregation command
//
R = db.runCommand(
{
"aggregate": "logs" ,
"pipeline": pipeline
}
);
printjson(R);