@@ -92,73 +92,18 @@ source to the destination cluster.
92
92
and replica sets that use MongoDB 4.4 or earlier
93
93
releases, since the document field order can vary.
94
94
95
- * - Document Comparison
96
- - You can verify sync by comparing documents on the source
97
- and destination clusters.
98
-
99
- Write a script that queries collections on the source
100
- cluster and then checks that the correct documents,
101
- indexes, collections, metadata, and views exist with the
102
- same values on the destination cluster.
103
-
104
- Before you can verify data transfer with this method,
105
- ``mongosync`` must be in the ``COMMITTED`` state.
106
-
107
- * - .. _c2c-index-comparison:
108
-
109
- Index Comparison
110
- - To verify the transfer of indexes, run the
111
- :method:`db.collection.getIndexes` method on the source
112
- and destination clusters and compare the results.
113
-
114
- * - .. _c2c-metadata-comparison:
115
-
116
- Metadata Comparison
117
- - To verify the transfer of metadata, run the
118
- :method:`db.getCollectionInfos` method on the source and
119
- destination clusters and compare the results.
120
-
121
- * - .. _c2c-shardkey-comparison:
122
-
123
- Shard Key Comparison
124
- - To verify the transfer of shard keys to a synced collection, run a query on the ``config.collections``
125
- collection to find a document whose ``_id`` value is the namespace of the target collection.
126
- Compare the ``key`` value of this document in the source and destination clusters.
127
-
128
- For example, for a collection named ``pets`` in the ``records`` database, you can verify the shard key
129
- using the following query in :binary:`mongosh`:
130
-
131
- .. io-code-block::
132
- :copyable: true
133
-
134
- .. input::
135
- :language: javascript
136
-
137
- db.getSiblingDB("config").collections.find({ _id : "records.pets" })
138
-
139
- .. output::
140
- :language: javascript
141
- :emphasize-lines: 5-7
142
- :visible: false
143
-
144
- {
145
- "_id" : "records.pets",
146
- "lastmod" : ISODate("2021-07-21T15:48:15.193Z"),
147
- "timestamp": Timestamp(1626882495, 1),
148
- "key" : {
149
- "_id" : 1
150
- },
151
- "unique" : false,
152
- "lastmodEpoch" : ObjectId("5078407bd58b175c5c225fdc"),
153
- "uuid" : UUID("f8669e52-5c1b-4ea2-bbdc-a00189b341da")
154
- }
155
-
156
95
* - :ref:`Migration Verifier <c2c-migration-verifier>`
157
96
- Migration Verifier connects to the source and destination
158
97
clusters and performs a series of verification checks,
159
98
comparing documents, views, and indexes to confirm the
160
99
sync was successful.
161
100
101
+ * - :ref:`Verifying Data with Custom Scripts <c2c-custom-manual-verification>`
102
+ - Different types of data require different methods of verification. You can
103
+ can use custom or manual verification to verify :ref:`documents <c2c-document-comparison>`,
104
+ :ref:`indexes <c2c-index-comparison>`, :ref:`metadata <c2c-metadata-comparison>`,
105
+ and :ref:`shard keys <c2c-shardkey-comparison>`.
106
+
162
107
The specific method you use to verify your data depends on your
163
108
application workload and the complexity of the data.
164
109
@@ -169,6 +114,7 @@ application workload and the complexity of the data.
169
114
Use Document Counts </reference/verification/count>
170
115
Use Hash Comparison </reference/verification/hash>
171
116
Use Migration Verifier </reference/verification/verifier>
117
+ Verifying Data with Custom Scripts </reference/verification/custom-manual>
172
118
173
119
Learn More
174
120
----------
0 commit comments