The shard key is a field (or fields) in a collection document. At this point, you're probably wondering: okay... so, what's the big deal? To answer this rhetorical question: the shard key is used by the sharded cluster balancer (https://docs.mongodb.com/manual/core/sharding-balancer-administration/#sharded-cluster-balancer) to determine how documents are distributed into chunks, and how chunks are distributed between shards. This can be quite a weighty decision as a poor choice of shard key could result in an uneven distribution of documents, leading to poor performance and an overwhelmed server. What's even more important is that the choice of shard key cannot be changed once the sharded cluster is initiated. Accordingly, you need to put careful thought into your choice for a shard key!
Understanding the shard key
As of MongoDB 4.2, although you are still not allowed to change the choice of shard key, you can now change the value of the data in the shard key. This feature...