diff options
author | Jonathan Abrahams <jonathan@mongodb.com> | 2016-03-09 12:17:50 -0500 |
---|---|---|
committer | Jonathan Abrahams <jonathan@mongodb.com> | 2016-03-09 12:18:14 -0500 |
commit | 4ae691e8edc87d0e3cfb633bb91c328426be007b (patch) | |
tree | 52079a593f54382ca13a2e741633eab1b6271893 /jstests/sharding/implicit_db_creation.js | |
parent | a025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff) | |
download | mongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz |
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/sharding/implicit_db_creation.js')
-rw-r--r-- | jstests/sharding/implicit_db_creation.js | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/jstests/sharding/implicit_db_creation.js b/jstests/sharding/implicit_db_creation.js index 19c48a5f03b..ed202ff2ea5 100644 --- a/jstests/sharding/implicit_db_creation.js +++ b/jstests/sharding/implicit_db_creation.js @@ -2,45 +2,45 @@ * This tests the basic cases for implicit database creation in a sharded cluster. */ (function() { -"use strict"; + "use strict"; -var st = new ShardingTest({ shards: 2 }); -var configDB = st.s.getDB('config'); + var st = new ShardingTest({shards: 2}); + var configDB = st.s.getDB('config'); -assert.eq(null, configDB.databases.findOne()); + assert.eq(null, configDB.databases.findOne()); -var testDB = st.s.getDB('test'); + var testDB = st.s.getDB('test'); -// Test that reads will not result into a new config.databases entry. -assert.eq(null, testDB.user.findOne()); -assert.eq(null, configDB.databases.findOne({ _id: 'test' })); + // Test that reads will not result into a new config.databases entry. + assert.eq(null, testDB.user.findOne()); + assert.eq(null, configDB.databases.findOne({_id: 'test'})); -assert.writeOK(testDB.user.insert({ x: 1 })); + assert.writeOK(testDB.user.insert({x: 1})); -var testDBDoc = configDB.databases.findOne(); -assert.eq('test', testDBDoc._id, tojson(testDBDoc)); + var testDBDoc = configDB.databases.findOne(); + assert.eq('test', testDBDoc._id, tojson(testDBDoc)); -// Test that inserting to another collection in the same database will not modify the existing -// config.databases entry. -assert.writeOK(testDB.bar.insert({ y: 1 })); -assert.eq(testDBDoc, configDB.databases.findOne()); + // Test that inserting to another collection in the same database will not modify the existing + // config.databases entry. + assert.writeOK(testDB.bar.insert({y: 1})); + assert.eq(testDBDoc, configDB.databases.findOne()); -st.s.adminCommand({ enableSharding: 'foo' }); -var fooDBDoc = configDB.databases.findOne({ _id: 'foo' }); + st.s.adminCommand({enableSharding: 'foo'}); + var fooDBDoc = configDB.databases.findOne({_id: 'foo'}); -assert.neq(null, fooDBDoc); -assert(fooDBDoc.partitioned); + assert.neq(null, fooDBDoc); + assert(fooDBDoc.partitioned); -var newShardConn = MongoRunner.runMongod({}); -var unshardedDB = newShardConn.getDB('unshardedDB'); + var newShardConn = MongoRunner.runMongod({}); + var unshardedDB = newShardConn.getDB('unshardedDB'); -unshardedDB.user.insert({ z: 1 }); + unshardedDB.user.insert({z: 1}); -assert.commandWorked(st.s.adminCommand({ addShard: newShardConn.name })); + assert.commandWorked(st.s.adminCommand({addShard: newShardConn.name})); -assert.neq(null, configDB.databases.findOne({ _id: 'unshardedDB' })); + assert.neq(null, configDB.databases.findOne({_id: 'unshardedDB'})); -MongoRunner.stopMongod(newShardConn.port); -st.stop(); + MongoRunner.stopMongod(newShardConn.port); + st.stop(); })(); |