How do I get the last item in a MongoDB collection?
问题 I'm using MongoDB for sometime to perform all sort of fast inserts or having as a log, but I'm having some trouble to get a really simple query How, in Mongo, would I do to get a similiar to this T-SQL SELECT TOP 1 [date] FROM [Collection] ORDER BY [date] desc In other words, what is the last date in the collection. I'm trying to use FindOne or any other that can return one document, but none accepts a sortBy property... how would I do this? var query = Query.EQ("status", "pending"); var