MongoDB supports two sharding strategies for distributing data across sharded clusters.
Hashed sharding uses either a single field hashed index or a compound hashed index as the shard key to partition data across your sharded cluster.
Hashed Sharding involves computing a hash of the shard key field's value. Each chunk is then assigned a range based on the hashed shard key values.
Hashed sharding provides a more even data distribution across the sharded cluster at the cost of reducing Targeted Operations vs. Broadcast Operations.
Post-hash, documents with 'close' shard key values are unlikely to be on the same chunk or shard - the mongos is more likely to perform Broadcast Operations to fulfill a given ranged query.
Range-based sharding involves dividing data into contiguous ranges determined by the shard key values.
Each chunk is then assigned a range based on the shard key values.
In this model, documents with 'close' shard key values are likely to be in the same chunk or shard.