I have a clustered collection that uses custom ids of unique integers. When I query using a sort by _id, the result is not sorted and sometimes returns different results.
This collection has a secondary index, but that index is not usable. When explaining the query plan it seems that no index is used, as indexFilterSet is set to false.
Is it possible to sort by _id descending in a clustered index? I cannot find documentation detailing that this is not possible, but it doesn’t seem to work.
This is the type of query I am attempting:
db.collection.find({}).sort({ _id: -1}).limit(5)