AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

カスタム スクリプトによるデータの検証

ソースクラスターをクエリし、ドキュメント、インデックス、コレクション、メタデータ、ビューを宛先クラスターと比較するためのスクリプトを記述できます。

ソースクラスターと宛先クラスターのドキュメントを比較することで、同期を確認できます。

この方法でデータ転送を確認する前に、mongosyncCOMMITTED 状態である必要があります。

To verify the transfer of indexes, run db.collection.getIndexes() on the source and destination clusters and compare the results.

To verify the transfer of metadata, run db.getCollectionInfos() on the source and destination clusters and compare the results.

同期されたコレクションへのシャードキーの転送を確認するには、config.collectionsコレクションに対してクエリを実行して、_id がターゲットコレクションの名前空間であるドキュメントを見つけます。 ソースクラスターと宛先クラスターでこのドキュメントの key 値を比較します。

For example, for a collection named pets in the records database, you can verify the shard key using the following query in mongosh:

db.getSiblingDB("config").collections.find({ _id : "records.pets" })