Files
mongo/jstests/sharding/read_does_not_create_namespaces.js
Kaloian Manassiev 38e5c4febb SERVER-21009 Get rid of some unused/unnecessary methods in ShardingTest
Removes shardGo in lieu of shardColl and removes setBalancer because it
duplicates functionality, which is already in sh.
2015-10-27 08:24:24 -04:00

17 lines
625 B
JavaScript

// This test ensures that just attempting to read from a non-existent database or collection won't
// cause entries to be created in the catalog.
(function() {
var shardingTest = new ShardingTest({ name: 'read_does_not_create_namespaces', shards: 1 });
var db = shardingTest.getDB('NonExistentDB');
assert.isnull(db.nonExistentColl.findOne({}));
// Neither the database nor the collection should have been created
assert.isnull(shardingTest.getDB('config').databases.findOne({ _id: 'NonExistentDB' }));
assert.eq(-1, shardingTest.shard0.getDBNames().indexOf('NonExistentDB'));
shardingTest.stop();
})();