I have a collection and I do this query :
db.getCollection("test").find(
{"$or":[{_id:NumberLong("1234")},
{_id:NumberLong("1230")},
{_id:NumberLong("1237")},
{_id:NumberLong("1236")}}
)
In with order will be the returned documents ? I need this exact order (with is the order of the $or
statement) :
1234
1230
1237
1236
normally it's the order I see when I do the previous query, but today I saw one query that return me a different order (and this just one time, because after i restarted the server the order was good again). So what to do to have exactly the exact order I need ?