Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{"iso_code":"AFG","country":"Afghanistan"},{"iso_code":"OWID_1234","country":"Africa"}]
Query
db.collection.aggregate([{"$match":{$expr:{$eq:[3,{"$strLenCP":"$iso_code"}]}}},{$group:{_id:"$country"}}])
Result