MongoDB uses the shard key to distribute the collection's documents across shards. The shard key consists of a field or multiple fields in the documents.
Documents in sharded collections can be missing the shard key fields. Missing shard key fields are treated as having null values when distributing the documents across shards but not when routing queries.
Starting in MongoDB 5.0, you can reshard a collection by changing a collection's shard key.
You can refine a shard key by adding a suffix field or fields to the existing shard key.
A document's shard key value determines its distribution across the shards. You can update a document's shard key value unless your shard key field is the immutable _id field.
To shard a populated collection, the collection must have an index that starts with the shard key. When sharding an empty collection, MongoDB creates the supporting index if the collection does not already have an appropriate index for the specified shard key.
The choice of shard key affects the performance, efficiency, and scalability of a sharded cluster. A cluster with the best possible hardware and infrastructure can be bottlenecked by the choice of shard key.