This version of the documentation is archived and no longer supported.


sh.moveChunk(collection, query, destination)
  • collection (string) – Specify the sharded collection containing the chunk to migrate.
  • query – Specify a query to identify documents in a specific chunk. Typically specify the shard key for a document as the query.
  • destination (string) – Specify the name of the shard that you wish to move the designated chunk to.

Moves the chunk containing the documents specified by the query to the shard described by destination.

This function provides a wrapper around the moveChunk. In most circumstances, allow the balancer to automatically migrate chunks, and avoid calling sh.moveChunk() directly.

See also

moveChunk” and “Sharding” for more information.