When you define a zone, you also associate a shard to the zone. This can be accomplished with the sh.addShardToZone() helper method. Here is the generic syntax:
sh.addShardToZone(SHARD, ZONE);
Both arguments are strings. SHARD represents the name of the shard, and ZONE is an arbitrary tag or label. In our sharded cluster model, let's say we wish to create zones based on continents and oceans. We might issue the following set of commands to create zones and distribute them between shards:
sh.addShardToZone("repl_shard_1", "americas");
sh.addShardToZone("repl_shard_1", "atlantic");
sh.addShardToZone("repl_shard_2", "africa");
sh.addShardToZone("repl_shard_2", "europe");
sh.addShardToZone("repl_shard_3", "asia");
sh.addShardToZone("repl_shard_3", "australia");
sh.addShardToZone("repl_shard_3", "indian");
sh...