Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{"_id":1,"arr":["foo","bar"]}]
Query
db.collection.aggregate([{$match:{_id:1}},{$project:{arr:{$setUnion:["$arr",["baz","abc","bar"]]}}}])
Result