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

컬렉션 생성, 보기, 제거 및 샤드

You can manage the collections in your clusters using the Atlas UI and mongosh.

다음 표에서는 Atlas 프로젝트에서 컬렉션을 관리하는 데 필요한 역할에 대해 설명합니다:

작업
필수 역할

컬렉션 생성

컬렉션 보기

최소한 Project Data Access Read Only 역할이 있어야 합니다.

제거 컬렉션

다음 역할 중 하나입니다.

샤드 컬렉션

다음 역할 중 하나입니다.

팁

새 데이터베이스에서 첫 번째 컬렉션을 만들려면 데이터베이스 생성을 참조하세요.

중요

config 및 system 데이터베이스에서는 새 컬렉션을 만들 수 없습니다. Atlas는 가까운 시일 내에 이러한 데이터베이스의 기존 컬렉션에 대한 쓰기 기능을 중단할 예정입니다.

Atlas UI를 통해 기존 데이터베이스에서 컬렉션을 만들려면 다음과 같이 하세요:

Atlas UI를 통해 클러스터의 데이터베이스 및 컬렉션을 보는 방법:

1
  1. 아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 내비게이션 바의 Projects 메뉴에서 프로젝트를 선택합니다.

  3. 사이드바에서 Database 제목 아래의 Data Explorer를 클릭합니다.

    The Data Explorer displays.

중요: 클러스터 이름을 클릭하여 Cluster 사이드바를 연 다음 제목 아래에 Data Explorer 있는 Shortcuts 를 클릭할 수도 있습니다.

2

데이터베이스의 이름을 클릭합니다.

참고

Atlas는 collStats를 사용하여 캐시된 메타데이터를 기반으로 이 탭에 표시되는 문서 수를 계산합니다. 이 개수는 컬렉션의 실제 문서 수와 다를 수 있습니다. 예를 들어, 예기치 않은 종료로 인해 집계가 중단될 수 있습니다. 가장 정확한 문서 수를 계산하려면 db.collection.countDocuments() 메서드를 사용합니다.

데이터베이스와 컬렉션의 데이터를 시각화하기 위해 MongoDB Charts를 실행합니다.

1
  1. 아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 내비게이션 바의 Projects 메뉴에서 프로젝트를 선택합니다.

  3. 사이드바에서 Database 제목 아래의 Data Explorer를 클릭합니다.

    The Data Explorer displays.

중요: 클러스터 이름을 클릭하여 Cluster 사이드바를 연 다음 제목 아래에 Data Explorer 있는 Shortcuts 를 클릭할 수도 있습니다.

2

To visualize data in MongoDB Charts from the Atlas UI, click Visualize Your Data when viewing a specific database or collection. Charts loads the data source and you can start building a chart in the Charts view. For detailed steps, see Build Charts.

Atlas UI를 통해 문서 및 인덱스를 포함한 컬렉션을 제거하려면 다음을 수행합니다.

1
  1. 아직 표시되지 않은 경우 탐색 표시줄의 Organizations 메뉴에서 프로젝트가 포함된 조직을 선택합니다.

  2. 아직 표시되지 않은 경우 내비게이션 바의 Projects 메뉴에서 프로젝트를 선택합니다.

  3. 사이드바에서 Database 제목 아래의 Data Explorer를 클릭합니다.

    The Data Explorer displays.

중요: 클러스터 이름을 클릭하여 Cluster 사이드바를 연 다음 제목 아래에 Data Explorer 있는 Shortcuts 를 클릭할 수도 있습니다.

2

Connections 사이드바에서 삭제하려는 컬렉션 옆에 있는 아이콘을 클릭합니다. 표시되는 드롭다운 메뉴에서 Drop Collection를 클릭합니다.

3

컬렉션의 이름을 입력하여 확인하고 Drop Database을 을 클릭합니다.

If you have large data sets and perform high throughput operations, you can shard a collection to distribute data across the shards.

You cannot shard a collection through the Atlas UI. To shard a collection, first confirm that your cluster is a sharded cluster, then take the following steps to shard the collection in mongosh:

1

mongosh 를 통해 클러스터에 연결을 참조하세요.

2

샤드 키에 대한 인덱스를 생성하려면 다음 명령을 실행합니다.

db.<collection-name>.createIndex({<shard_key_definition>})

예시

sample_analytics.customers 컬렉션의 샤드 키에 인덱스를 생성합니다.

db.sample_analytics.createIndex( { "username": 1 } )

자세한 내용은 다음을 참조하세요.

3

컬렉션을 샤딩하려면 다음 명령을 실행합니다.

sh.shardCollection("<database>.<collection>", { "<indexed-field>" : 1 } )

예시

sample_analytics.customers 컬렉션을 샤드하기 위해:

sh.shardCollection("sample_analytics.customers", { "username" : 1 } )

WARNING: If you shard a collection that already has a MongoDB Search index, you might experience a brief period of incomplete search results while the index is building on a shard. Also, if you add a shard for an already sharded collection that contains a MongoDB Search index, your search queries against that collection might return incomplete results until the initial sync process completes on the added shards. To learn more, see initial sync process.

To learn more, see Shard a Collection in the MongoDB manual.