From 2739eb4ecd1cf45cb49df48b03e958444c471358 Mon Sep 17 00:00:00 2001 From: auto-revert-processor Date: Thu, 13 Jan 2022 09:18:09 +0000 Subject: Revert "SERVER-62443 Add `collectionUUID` parameter to `find` command" This reverts commit eb75b6ccc62f7c8ea26a57c1b5eb96a41809396a. --- jstests/core/collection_uuid_find.js | 56 ------------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 jstests/core/collection_uuid_find.js (limited to 'jstests/core') diff --git a/jstests/core/collection_uuid_find.js b/jstests/core/collection_uuid_find.js deleted file mode 100644 index e958bffa890..00000000000 --- a/jstests/core/collection_uuid_find.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Tests the collectionUUID parameter of the find command. - * - * @tags: [ - * featureFlagCommandsAcceptCollectionUUID, - * tenant_migration_incompatible, - * ] - */ -(function() { -'use strict'; - -const testDB = db.getSiblingDB(jsTestName()); -assert.commandWorked(testDB.dropDatabase()); - -const coll = testDB['coll']; -assert.commandWorked(coll.insert({_id: 0})); - -const uuid = - assert.commandWorked(testDB.runCommand({listCollections: 1})).cursor.firstBatch[0].info.uuid; - -// The command succeeds when the correct UUID is provided. -assert.commandWorked(testDB.runCommand({find: coll.getName(), collectionUUID: uuid})); - -// The command fails when the provided UUID does not correspond to an existing collection. -const nonexistentUUID = UUID(); -let res = assert.commandFailedWithCode( - testDB.runCommand({find: coll.getName(), collectionUUID: nonexistentUUID}), - ErrorCodes.CollectionUUIDMismatch); -assert.eq(res.collectionUUID, nonexistentUUID); -assert.eq(res.actualNamespace, ""); - -// The command fails when the provided UUID corresponds to a different collection. -const coll2 = testDB['coll_2']; -assert.commandWorked(coll2.insert({_id: 1})); -res = assert.commandFailedWithCode(testDB.runCommand({find: coll2.getName(), collectionUUID: uuid}), - ErrorCodes.CollectionUUIDMismatch); -assert.eq(res.collectionUUID, uuid); -assert.eq(res.actualNamespace, coll.getFullName()); - -// The command fails when the provided UUID corresponds to a different collection, even if the -// provided namespace does not exist. -coll2.drop(); -res = assert.commandFailedWithCode(testDB.runCommand({find: coll2.getName(), collectionUUID: uuid}), - ErrorCodes.CollectionUUIDMismatch); -assert.eq(res.collectionUUID, uuid); -assert.eq(res.actualNamespace, coll.getFullName()); - -// The command fails when the provided UUID corresponds to a different collection, even if the -// provided namespace is a view. -const view = db['view']; -assert.commandWorked(testDB.createView(view.getName(), coll.getName(), [])); -res = assert.commandFailedWithCode(testDB.runCommand({find: view.getName(), collectionUUID: uuid}), - ErrorCodes.CollectionUUIDMismatch); -assert.eq(res.collectionUUID, uuid); -assert.eq(res.actualNamespace, coll.getFullName()); -})(); -- cgit v1.2.1