OPTIONS

sh.splitAt()

Definition

sh.splitAt(namespace, query)

Splits the chunk containing the document specified by the query as if that document were at the “middle” of the collection, even if the specified document is not the actual median of the collection.

Parameter Type Description
namespace string The namespace (i.e. <database>.<collection>) of the sharded collection that contains the chunk to split.
query document A query to identify a document in a specific chunk. Typically specify the shard key for a document as the query.

Use this command to manually split chunks unevenly. Use the “sh.splitFind()” function to split a chunk at the actual median.

In most circumstances, you should leave chunk splitting to the automated processes within MongoDB. However, when initially deploying a sharded cluster it is necessary to perform some measure of pre-splitting using manual methods including sh.splitAt().

ON THIS PAGE