I know that MongoDB supports the syntax find{array.0.field:\"value\"}, but I specifically want to do this for the last element in the array, which means I don\'
find{array.0.field:\"value\"}
In 3.2 this is possible. First project so that myField contains only the last element, and then match on myField.
db.collection.aggregate([ { $project: { id: 1, myField: { $slice: [ "$myField", -1 ] } } }, { $match: { myField: "myValue" } } ]);