Primary Shard¶
In general, you should not need to specify the primaryShard in the command. Instead, allow the balancer to select the primary shard.
However, if you do specify the primaryShard in the command for a database and the database is already sharding enabled with a different primary shard, the operation returns an error and the primary shard for the database remains as before. To change the primary shard for a database, use movePrimary
instead.