Let\'s say i want to return the latest inserted document from the subdocument. I want to be able to return the second record within the tags array w/ the _id
of
I needed to find the last entry of subdocuments and I managed to make it to work with the $slice
projection operator: mondodb.com > $slice (projection)
db.modules.find({_id:'ui', 'svn_branches.branch':'Rocky'},
{ 'svn_branches.tags': {$slice:-1} } )
I had only one level, if this doesn't work, please let me know.