Database

[{"key":"key1"},{"key":"key2"}]

Query

db.collection.aggregate([{$group:{_id:null,key:{$push:"$key"}}}])

Result