New in version 3.4: Associates a shard with a zone. MongoDB associates this shard with the given zone. Chunks that are covered by the zone are assigned to shards associated with the zone.
addShardToZone command has the following syntax:
You can associate a zone with multiple shards, and a shard can associate with multiple zones.
See the zone manual page for more information on zones in a sharded cluster.
For sharded clusters that enforce access control, you must authenticate as a user whose privileges include either:
shardscollection in the
configdatabase; or, alternatively,
enableShardingon the cluster resource (available starting in version 3.6.16).
The following example associates
shard0000 with zone
A shard can associate with multiple zones. The following example associates
shard0000 associates with both the
LGA zone and the
JFK zone. In a balanced cluster, MongoDB routes reads and writes covered by either zone to