> db.arrays.find({},{a:{$slice:-1}})
{ "_id" : 1, "a" : [ 3 ] }
> db.arrays.findOne()
{ "_id" : 1, "a" : [ 1, 2, 3 ] }
> db.arrays.find({},{a:{$slice:[-1,0]}})
error: { "$err" : "$slice limit must be positive", "code" : 13100 }
Please provide your code if this doesn't make sense, or solve your problem.
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
> To unsubscribe from this group, send email to mongodb-user+unsubscribe@googlegroups.com.