File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,41 @@ source to the destination cluster.
118118 :method:`db.getCollectionInfos` method on the source and
119119 destination clusters and compare the results.
120120
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+
121156 * - :ref:`Migration Verifier <c2c-migration-verifier>`
122157 - Migration Verifier connects to the source and destination
123158 clusters and performs a series of verification checks,
You can’t perform that action at this time.
0 commit comments