I encountered a strange behavior in Mongo 2.6.x. i am using Mongoid in ruby talk to MongoDB and Mongoid allows having default sort command. When I run the following command :
Person.find("someindex") in Mongoid, it is translated into
Mongoid is not really smart by generating such query because we know we will get either 0 or 1 result, so the sort operator does not make sense.
However, I've found cases where MongoDB is even less smart and caches the wrong index, including the created_at field.
I would expect MongoDB to automatically use the _id index whenever it is present in the query, no matter other fields that are present in the query, in partcular sort commands.
I already had a discussion about this on google group: