注意
This page applies to Atlas Infinite clusters and Atlas Core clusters. On an Atlas Infinite cluster, you can read the oplog collection as described on this page, but you can't set an oplog size. The collection serves change streams and some internal functions rather than replication, which the storage layer handles. To learn how the oplog behaves on an Atlas Infinite cluster, see Oplog on Atlas Infinite clusters.
特別な 上限付きコレクションである oplog は、データベースに保存されているデータを変更する操作を記録します。
You must precede a $regex query on an oplog in a Free cluster or a Flex cluster with a carat (^). Otherwise, the following error occurs:
MongoServerError: Oplog ns RegEx queries must begin with ^
oplog アクセス権を持つユーザーの追加
oplog にアクセスするには、データベースユーザーがlocalデータベースに対する読み取りアクセス権を持っている必要があります。localに読み取りアクセス権を持つユーザーを作成する:
Atlas で、プロジェクトの Database & Network Access ページに移動します。
まだ表示されていない場合は、プロジェクトを含む組織をナビゲーション バーの Organizations メニューで選択します。
まだ表示されていない場合は、ナビゲーション バーの Projects メニューからプロジェクトを選択します。
サイドバーで、 Security見出しの下のDatabase & Network Accessをクリックします。
The Database & Network Access page displays after you complete the preceding steps.
oplog にアクセスする
Connect to your cluster with the
mongosh, using the credentials of the new database user with access to thelocaldatabase.localデータベースに切り替えます。> use local
注意
クラスターの oplog のサイズを増やすには、 「oplog サイズの設定」を参照してください。
MongoDB のコマンド replSetResizeOplog を使用して oplog のサイズを変更することはできません。