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

여러 문서를 삽입합니다.

동기 InsertMany() 방법 또는 비동기 InsertManyAsync() 방법을 사용하여 collection에 단일 문서를 삽입할 수 있습니다.

다음은 restaurants 컬렉션에 새 문서를 삽입하는 예시입니다.

Asynchronous 또는 Synchronous 탭을 선택하여 해당 코드를 확인합니다.

// Generates 5 new restaurants by using a helper method
var restaurants = GenerateDocuments();
// Asynchronously inserts the new documents into the restaurants collection
await _restaurantsCollection.InsertManyAsync(restaurants);

InsertManyAsync() 작업의 완전히 실행 가능한 예시는 InsertManyAsync 코드 샘플를 참조하세요.

// Generates 5 new restaurants by using a helper method
var restaurants = GenerateDocuments();
// Inserts the new documents into the restaurants collection
_restaurantsCollection.InsertMany(restaurants);

InsertMany() 작업의 완전히 실행 가능한 예시는 InsertMany 코드 샘플참조하세요.

위의 전체 예시 중 하나를 실행한 후 출력은 다음과 같습니다.

Number of restaurants found before insert: 0
Inserting documents...
Number of restaurants inserted: 5

빌더 사용에 대해 자세히 알아보려면 빌더를 사용한 작업을 참조하세요.