Verify with Document Counts
On this page
The most basic method of verification is to compare the number of documents in each synced collection on the source cluster to the number on the destination cluster.
This method only verifies a successful sync when run against clusters with insert-only workloads. If you do not have an insert-only workload for the cluster, use a different verification method.
Steps
Count Source Documents
Run the countDocuments()
method on each synced
collection on the source cluster:
db.us_accounts.countDocuments()
345
Note the number of documents.
Count Destination Documents
Run the countDocuments()
method on each synced
collection on the destination cluster:
db.us_accounts.countDocuments()
345
Note the number of documents.
Compare Counts
Compare the results of each document count:
If the document count is different, not all changes synced to the destination cluster.
If the document count is the same and your cluster has an insert-only workload, the sync was successful.
If your source cluster does not have an insert-only workload, use a different method to verify sync.