사용자 지정 CRUD 설정 구성
이 페이지의 내용
개요
In this guide, you can learn about how the Java driver configures CRUD
operations for MongoDatabase
and MongoCollection
instances.
읽기 설정, 읽기 고려, 쓰기 고려는 드라이버가 읽기 작업을 라우팅하고 MongoDB 복제본 세트에 연결될 때 읽기 및 쓰기 작업에 대한 승인을 기다리는 방법을 제어합니다. 읽기 설정 및 읽기 고려는 모든 읽기 작업에 적용되고 쓰기 고려는 모든 쓰기 작업에 적용됩니다.
자세한 내용은 읽기 설정, 읽기 고려 및 쓰기 고려에 대한 서버 설명서를 참조하세요.
By default, MongoDatabase
and MongoCollection
instances inherit their preferences
and concerns from the MongoClient
that accesses them. See the
클라이언트 수준 CRUD 설정 구성 page for
more information. However, you can apply custom settings to your individual databases and
collections by using the following methods:
팁
withReadConcern()
, withReadPreference()
, withWriteConcern
메서드는 원하는 설정이나 고려 항목이 있는 MongoDatabase
또는 MongoCollection
인스턴스를 새로 만듭니다. 메서드가 호출되는 MongoDatabase
또는 MongoCollection
은 원래 설정 및 고려 설정을 유지합니다.