0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/sharding/read_does_not_create_namespaces.js
Kaloian Manassiev 8e6804d268 SERVER-17723 Sharding catalog cache
This change builds a sharding catalog cache on top of the CatalogManager
abstraction and use this in place of the direct network calls to the
config server.
2015-04-10 16:29:38 -04:00

12 lines
579 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.
var shardingTest = new ShardingTest('read_does_not_create_namespaces', 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();