how to find into mongodb to the last item of an array?

hell

New Member
I want to find documents where last elements in an array equals to some value.Array elements may be accessed by specific array position:// i.e. comments[0].by == "Abe"\[quote\] db.example.find( { "comments.0.by" : "Abe" } )\[/quote\]but how do i search using the last item as criteria?i.e.\[quote\] db.example.find( { "comments.last.by" : "Abe" } )\[/quote\]By the way, i'm using php
 
Back
Top