Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{name:"abc",pro:1},{name:"cde",pro:2},{name:"fgh",pro:3},{name:"ijk",pro:4}]
Query
db.collection.aggregate([{$project:{_id:0,name:1,pro:{$slice:[["","a","b","c","d"],"$pro",1]}}},{"$unwind":"$pro"}])
Result