https://docs.mongodb.com/manual/core/index-unique/#sharded-clusters-and-unique-indexes
If the _id
field is not the shard key or the prefix of the shard key, _id
index only enforces the uniqueness constraint per shard and not across shards.
If the _id
field is not the shard key nor the prefix of the shard key, MongoDB expects applications to enforce the uniqueness of the _id
values across the shards.
What is the difference?