diff options
author | Geert Bosch <geert@mongodb.com> | 2017-07-03 18:08:44 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-07-12 13:01:34 -0400 |
commit | 1d6008b049e65615b13404f0b877034cfa980220 (patch) | |
tree | 0824620abe47524b2899506690faf038f161c99a /jstests/noPassthrough/collation_clone_collection.js | |
parent | 8e51f8b78e674d1098eb44ec86802f5a2a478cc5 (diff) | |
download | mongo-1d6008b049e65615b13404f0b877034cfa980220.tar.gz |
SERVER-30105 Don't expect unchanging UUIDs on collection cloning
Diffstat (limited to 'jstests/noPassthrough/collation_clone_collection.js')
-rw-r--r-- | jstests/noPassthrough/collation_clone_collection.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/jstests/noPassthrough/collation_clone_collection.js b/jstests/noPassthrough/collation_clone_collection.js index 1db8fec3841..bac97b1b8f3 100644 --- a/jstests/noPassthrough/collation_clone_collection.js +++ b/jstests/noPassthrough/collation_clone_collection.js @@ -16,7 +16,12 @@ assert.commandWorked(sourceColl.getDB().runCommand( {create: sourceColl.getName(), collation: {locale: "en", strength: 2}})); - var sourceCollectionInfos = sourceColl.getDB().getCollectionInfos({name: sourceColl.getName()}); + // We remove UUIDs before comparing as collection cloning results in a new UUID. + var sourceCollectionInfos = + sourceColl.getDB().getCollectionInfos({name: sourceColl.getName()}).map((collInfo) => { + delete collInfo.info.uuid; + return collInfo; + }); assert.writeOK(sourceColl.insert({_id: "FOO"})); assert.writeOK(sourceColl.insert({_id: "bar"})); @@ -44,7 +49,11 @@ query: {_id: "foo"} })); - var destCollectionInfos = destColl.getDB().getCollectionInfos({name: destColl.getName()}); + var destCollectionInfos = + destColl.getDB().getCollectionInfos({name: destColl.getName()}).map((collInfo) => { + delete collInfo.info.uuid; + return collInfo; + }); assert.eq(sourceCollectionInfos, destCollectionInfos); assert.eq([{_id: "FOO"}], destColl.find({}).toArray()); |