Database

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

Query

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

Result