summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/drop_config_db.js
blob: c629d41d7a9cada2ca6489fedf2255f41779d241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Test that dropping the config DB does not crash the server.
 */
(function() {
"use strict";

TestData.enableTestCommands = false;

const mongod = MongoRunner.runMongod();
const config = mongod.getDB('config');

// Create a collection in config to ensure that it exists before dropping it.
assert.commandWorked(config.runCommand({create: 'test'}));
// Dropping the config DB should succeed.
assert.commandWorked(config.dropDatabase());

MongoRunner.stopMongod(mongod);
})();