Ja, maar de aanpak is iets anders:
db.myCol.aggregate([
{$sort: {value:-1}},
{$group:{
_id: "$user",
doc: {$first: "$$ROOT"}
}},
{$replaceRoot: {newRoot: "$doc"} }
])
Ja, maar de aanpak is iets anders:
db.myCol.aggregate([
{$sort: {value:-1}},
{$group:{
_id: "$user",
doc: {$first: "$$ROOT"}
}},
{$replaceRoot: {newRoot: "$doc"} }
])