sh.enableSharding()

Definition

  • sh.enableSharding(database)
  • Enables sharding on the specified database. This does notautomatically shard any collections but makes it possible to beginsharding collections using sh.shardCollection().

The sh.enableSharding() method has the following parameter:

ParameterTypeDescriptiondatabasestringThe name of the database shard. Enclose the name in quotation marks.

mongos uses"majority" for theenableSharding command and its helpersh.enableSharding().

See also

sh.shardCollection()