On this page本页内容
sh.splitFind(namespace, query)
Splits the chunk that contains the shard key value specified by the 在块的中间点拆分包含query
at the chunk's median point. sh.splitFind()
creates two roughly equal chunks. query
指定的分片键值的块。sh.splitFind()
创建两个大致相等的块。To split a chunk at a specific point instead, see 要在特定点拆分块,请参阅sh.splitAt()
.sh.splitAt()
。
The method takes the following arguments:该方法采用以下参数:
namespace | string | <database>.<collection> ) of the sharded collection that contains the chunk to split.<database>.<collection> )。 |
query | document |
The sh.splitFind()
method wraps the split
command.sh.splitFind()
方法包装了split
命令。
In most circumstances, you should leave chunk splitting to the automated processes within MongoDB.在大多数情况下,应该将区块分割留给MongoDB中的自动化进程。
To use 要使用sh.splitFind()
, the sharded collection must be populated.sh.splitFind()
,必须填充分片集合。
For the sharded collection 对于分片集合test.foo
, the following example splits, at the median point, a chunk that contains the shard key value x: 70
.test.foo
,以下示例在中间点分割一个包含分片键值x:70
的块。
sh.splitFind( "test.foo", { x: 70 } )