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

BSON 데이터로 작업하기

이 가이드에서는 BSON 데이터 형식, MongoDB가 이를 사용하는 방법, Kotlin 동기화 드라이버와 독립적으로 BSON 라이브러리를 설치하는 방법에 대해 학습할 수 있습니다.

BSON, or Binary JSON, is the data format that MongoDB uses to organize and store data. This data format includes all JSON data structure types and also supports other types, including dates, different size integers, ObjectId values, and binary data. For a complete list of supported types, see the BSON Types page in the MongoDB Server manual.

The binary format is not human-readable, but you can use the Java BSON library to convert it to a JSON representation. To learn more about the relationship between these formats, see the JSON and BSON article.

The Kotlin Sync driver, which uses the BSON library, allows you to work with BSON data by using one of the object types that implements the BSON interface. The following types implement the BSON interface:

이 섹션에서는 BSON 라이브러리를 프로젝트에 종속성으로 추가하는 방법을 설명합니다. Kotlin 동기화 드라이버를 프로젝트에 종속성으로 추가했은 경우, BSON 라이브러리가 이미 드라이버의 필수 종속성으로 포함되어 있으므로 이 단계는 건너랄시면 됩니다. 프로젝트에 Kotlin 동기화 드라이버를 종속성으로 추가하는 방법에 대한 지침은 Kotlin 동기화 드라이버 시작하기 가이드를 참조하세요.

BOM

드라이버 유물의 버전을 관리하려면 JVM 드라이버 BOM(Bill of Materials)을 애플리케이션에 추가하는 것을 권장합니다. 이렇게 하면 BOM에 포함되는 개별 패키지에 대해 버전을 지정할 필요가 제거되어 종속성 관리가 간단해집니다. 더 자세한 내용은 Kotlin 동기화 (Kotlin Sync) 드라이버 시작하기 가이드를 참조하세요.

Maven 또는 Gradle 빌드 자동화 도구를 사용하여 프로젝트의 종속 항목을 관리하는 것이 좋습니다. 다음 탭에서 선택하여 해당 도구의 종속성 선언을 확인합니다.

다음 스니펫은 pom.xml 파일의 dependencies 섹션에 있는 종속성 선언을 보여 줍니다.

<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>bson</artifactId>
</dependency>
</dependencies>

다음 스니펫은 build.gradle 파일의 dependencies 객체에 있는 종속성 선언을 보여 줍니다.

dependencies {
compile 'org.mongodb:bson'
}

앞의 도구 중 하나를 사용하지 않는 경우, sonatype 리포지토리에서 직접 JAR 파일 다운로드하여 프로젝트에 포함할 수 있습니다.