Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{"key":1},{"key":2}]
Query
db.collection.aggregate([{"$match":{key:1}},{$project:{"course":{"courseCode":"code2","name":"Terst class 2","officialCode":"test 202"}}},{"$replaceRoot":{"newRoot":"$course"}}])
Result