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

dataSize (데이터베이스 명령)

dataSize

The dataSize command returns the size in bytes for the specified data.

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

  • MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스

중요

이 명령은 M0 및 Flex 클러스터에서 지원되지 않습니다. 자세한 내용은 지원되지 않는 명령을 참조하세요.

명령은 다음과 같은 구문을 가집니다:

db.runCommand(
{
dataSize: <string>,
keyPattern: <document>,
min: <document>,
max: <document>,
estimate: <boolean>
}
)

이 명령은 다음 필드를 사용합니다.

필드
유형
설명

dataSize

문자열

대상 컬렉션의 이름입니다.

keyPattern

문서

선택 사항입니다. 컬렉션의 주요 패턴을 살펴보세요.

The collection must have an index with the corresponding pattern. Otherwise dataSize returns an error message.

min

문서

선택 사항입니다. 검사할 키 범위의 하한입니다.

max

문서

선택 사항입니다. 검사할 키 범위의 상한입니다.

estimate

부울

Optional. When true, dataSize estimates the data size by assuming that all documents in the specified range are uniformly sized as per the collection's average object size. The collection's average object size is obtained from the avgObjSize field in the output of the collStats command.

기본값은 false입니다.

The following operation runs the dataSize command on the database.collection collection, specifying a key pattern of {field: 1} with the lower bound of the range of keys to be examined being {field: 10} and the upper bound of the key to be examined being {field: 100}.

db.runCommand({ dataSize: "database.collection", keyPattern: { field: 1 }, min: { field: 10 }, max: { field: 100 } })

이는 일치하는 모든 문서에 대한 크기(바이트)의 문서를 반환합니다. database.collection을 배포서버의 데이터베이스 및 컬렉션으로 바꿉니다.

The amount of time required to return dataSize depends on the amount of data in the collection.

이 페이지 평가하기