I have Implemented sharding in mongodb when we shard a collection to two mongod shards on the basis of hashed shard key, so It does a parallel sort inside shards. After that, how it sorts the collection on the basis of _id? and what may be the other points of consideration? what are:
Not sure.
If you don't specify a sort, mongo will return records round-robin from the shards, which I assume means there is no guarantee of any specific ordering, or even reproducible order from query to query. If you have an explicit sort, the primary shard will perform a merge sort. See the mongos
docs
Of course.
(This is an old question but it comes up pretty high in Google results.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With