xxxxxxxxxx
db.foo.aggregate([
{
$group: {
"_id": "$_id",
"contents": { $push: "$contents" },
users: { $first: "$users" },
owners: { $first: "$owners" },
name: { $first: "$name" },
category: { $first: "$category" },
course: { $first: "$course" },
// and remaining fields
}
}
])