Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{"_id":"1","blocks":[{"port":[{"portType":{"function":"input"}}]}]}]
Query
db.collection.aggregate([{"$unwind":"$blocks"},{"$unwind":"$blocks.port"},{"$match":{"blocks.port.portType.function":"input"}}])
Result