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\"}
use $slice.
db.collection.find( {}, { array_field: { $slice: -1 } } )
Editing: You can make use of { : { $elemMatch: { , , ... } } } to find a match.
{ : { $elemMatch: { , , ... } } }
But it won't give exactly what you are looking for. I don't think that is possible in mongoDB yet.