mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
8e6804d268
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.
12 lines
579 B
JavaScript
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(); |