Template
single collection
multiple collections
mgodatagen
update
indexe
explain
Stage
Database
bson
mgodatagen
[{arry:[0,1],d:1},{arry:[1,0],d:0}]
Query
db.collection.aggregate([{$match:{$expr:{$lt:[{"$arrayElemAt":["$arry",0]},"$d"]}}}])
Result