You can use the special $natural index to get the last document in the
collection; this may not be the latest inserted if an update occurs
where the doc needs to be moved.
On Thu, Feb 3, 2011 at 1:06 PM, behrang <behrang....@gmail.com> wrote:
> Hi,
>
> What is the efficient way to get the last insert _id per collection?
> Something similar to LAST_INSERT_ID in mySQL.
> I am using pymongo 1.9.
>
> Thanks
> Behrang
>
> --
> 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.
>
>