发布于 2015-09-14 14:53:27 | 526 次阅读 | 评论: 0 | 来源: 网络整理
-
sh.shardCollection(collection, key, unique)
参数: |
- collection (string) – The namespace of the collection to shard.
- key (document) – A document containing a shard key
that the sharding system uses to
partition and distribute objects among
the shards.
- unique (boolean) – When true, the unique option ensures
that the underlying index enforces
uniqueness so long as the unique index is a
prefix of the shard key.
|
Shards the named collection, according to the specified
shard key. Specify shard keys in the form of a document.
Shard keys may refer to a single document field, or more typically
several document fields to form a “compound shard key.”
See
Size of Sharded Collection