Docs Home → Develop Applications → MongoDB Manual
sh.splitFind()![](/docs/v5.3/assets/link.svg)
On this page
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoDB server.
Definition![](/docs/v5.3/assets/link.svg)
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. To split a chunk at a specific point instead, seesh.splitAt()
.The method takes the following arguments:
ParameterTypeDescriptionnamespace
stringThe namespace (i.e.<database>.<collection>
) of the sharded collection that contains the chunk to split.query
documentA query document that specifies the shard key value that determines the chunk to split.The
sh.splitFind()
method wraps thesplit
command.
Consideration![](/docs/v5.3/assets/link.svg)
In most circumstances, you should leave chunk splitting to the automated processes within MongoDB.
To use sh.splitFind()
, the sharded collection must be
populated.
Example![](/docs/v5.3/assets/link.svg)
For the sharded collection test.foo
, the following example splits,
at the median point, a chunk that contains the shard key value x:
70
.
sh.splitFind( "test.foo", { x: 70 } )