There are likely more JavaScript tests which have been added since
r3.6.9 that still need to be tagged.
(cherry picked from commit 05ec08fa62)
30 lines
860 B
JavaScript
30 lines
860 B
JavaScript
// @tags: [
|
|
// assumes_superuser_permissions,
|
|
// requires_non_retryable_writes,
|
|
// ]
|
|
|
|
// Test the creation of view with a duplicate name to a collection.
|
|
|
|
(function() {
|
|
"use strict";
|
|
|
|
const dbName = "views_duplicate_ns";
|
|
const viewsDb = db.getSiblingDB(dbName);
|
|
const collName = "myns";
|
|
const viewId = dbName + "." + collName;
|
|
|
|
assert.commandWorked(viewsDb.dropDatabase());
|
|
assert.writeOK(viewsDb.system.views.remove({_id: viewId}));
|
|
assert.commandWorked(viewsDb.runCommand({create: collName}));
|
|
assert.writeOK(viewsDb.system.views.insert({
|
|
_id: viewId,
|
|
viewOn: "coll",
|
|
pipeline: [],
|
|
}));
|
|
assert.eq(2,
|
|
viewsDb.getCollectionInfos()
|
|
.filter(coll => {
|
|
return coll.name === collName;
|
|
})
|
|
.length);
|
|
}()); |