AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

sh.splitAt() (mongosh 메서드)

sh.splitAt(namespace, query)

쿼리에 지정된 샤드 키 값에서 청크를 분할합니다.

중요

Mongo쉬 방법

This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.

데이터베이스 명령에 대해서는 split 명령을 참조하십시오.

MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.

이 메서드는 다음과 같은 인수를 사용합니다.

Parameter
유형
설명

namespace

문자열

네임스페이스(예: <database>.<collection>) 분할할 청크가 포함된 샤드 컬렉션.

query

문서

청크를 분할할 샤드 키 값을 지정하는 쿼리 문서입니다.

이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

중요

This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.

In most circumstances, you should leave chunk splitting to the automated processes within MongoDB. However, when initially deploying a sharded cluster, it may be beneficial to pre-split manually an empty collection using methods such as sh.splitAt().

sh.splitAt() 원본 청크를 두 개의 청크로 분할합니다. 한 청크에는 원래 하한(포함)으로 시작하여 지정된 샤드 키 값(제외)에서 끝나는 샤드 키 범위가 있습니다. 다른 청크는 지정된 샤드 키 값(포함)을 하한으로 시작하여 원래의 상한(제외)에서 끝나는 샤드 키 범위를 갖습니다.

대신 중앙값에서 청크를 분할하려면 sh.splitFind() 를 참조하세요.

샤딩된 collection test.foo 의 경우 다음 예제에서는 샤드 키 값 x: 70 에서 청크를 splits합니다.

sh.splitAt( "test.foo", { x: 70 } )
이 페이지 평가하기