カスタムCRUD設定の構成
項目一覧
Overview
In this guide, you can learn about how the Java driver configures CRUD
operations for MongoDatabase
and MongoCollection
instances.
読み込み設定(read preference ) 、 読み取り保証( read concern ) 、 書込み保証( write concern ) は、MongoDB レプリカセットに接続するときに、ドライバーが読み取り操作をルーティングして読み取りおよび書込み操作の確認を待つ方法を制御します。 読み込み設定(read preference)と読み取り保証(read concern)はすべての読み取り操作に適用されます。書込み保証 (write concern) はすべての書込み (write) 操作に適用されます。
詳細については、 読み込み設定( read preference ) 、 読み取り保証( read concern ) 、 書込み保証( write concern) に関するサーバーのドキュメントを参照してください。
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:
Tip
withReadConcern()
withReadPreference()
、 、およびwithWriteConcern
MongoDatabase
MongoCollection
メソッドは、優先順位または保証を持つ または の新しいインスタンスを作成します。メソッドが呼び出されるMongoDatabase
またはMongoCollection
は、元の優先設定と保証設定を保持します。