I want to sort my index in a specific way (-1, 1) and want to make sure that null values are at the top of the index. How can I ensure this?
You have said" I just want to basically have an 'if one with null exists take it, else take one without' by one query", how about db.collection.find().sort().limit(1) ?