summaryrefslogtreecommitdiff
path: root/jstests/sharding/noUpdateButN1inAnotherCollection.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:17:50 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2016-03-09 12:18:14 -0500
commit4ae691e8edc87d0e3cfb633bb91c328426be007b (patch)
tree52079a593f54382ca13a2e741633eab1b6271893 /jstests/sharding/noUpdateButN1inAnotherCollection.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/sharding/noUpdateButN1inAnotherCollection.js')
-rw-r--r--jstests/sharding/noUpdateButN1inAnotherCollection.js44
1 files changed, 22 insertions, 22 deletions
diff --git a/jstests/sharding/noUpdateButN1inAnotherCollection.js b/jstests/sharding/noUpdateButN1inAnotherCollection.js
index 27c40e9056b..a95ee5924a0 100644
--- a/jstests/sharding/noUpdateButN1inAnotherCollection.js
+++ b/jstests/sharding/noUpdateButN1inAnotherCollection.js
@@ -1,57 +1,57 @@
-function debug( str ) {
- print( "---\n" + str + "\n-----" );
+function debug(str) {
+ print("---\n" + str + "\n-----");
}
var name = "badNonUpdate";
debug("Starting sharded cluster test stuff");
-var s = new ShardingTest({ name: name, shards: 2, mongos : 2 });
+var s = new ShardingTest({name: name, shards: 2, mongos: 2});
-var mongosA=s.s0;
-var mongosB=s.s1;
+var mongosA = s.s0;
+var mongosB = s.s1;
ns = "test.coll";
ns2 = "test.coll2";
-adminSA = mongosA.getDB( "admin" );
-adminSA.runCommand({ enableSharding : "test"});
+adminSA = mongosA.getDB("admin");
+adminSA.runCommand({enableSharding: "test"});
-adminSA.runCommand( { moveprimary : "test", to : "shard0000" } );
-adminSA.runCommand( { moveprimary : "test2", to : "shard0001" } );
+adminSA.runCommand({moveprimary: "test", to: "shard0000"});
+adminSA.runCommand({moveprimary: "test2", to: "shard0001"});
-adminSA.runCommand({ shardCollection : ns, key : { _id : 1 } });
+adminSA.runCommand({shardCollection: ns, key: {_id: 1}});
try {
- s.stopBalancer();
-} catch (e) {
- print("coundn't stop balancer via command");
+ s.stopBalancer();
+} catch (e) {
+ print("coundn't stop balancer via command");
}
-adminSA.settings.update({ _id: 'balancer' }, { $set: { stopped: true }});
+adminSA.settings.update({_id: 'balancer'}, {$set: {stopped: true}});
-var db = mongosA.getDB( "test" );
+var db = mongosA.getDB("test");
var coll = db.coll;
var coll2 = db.coll2;
numDocs = 10;
for (var i = 1; i < numDocs; i++) {
- coll.insert({_id:i, control:0});
- coll2.insert({_id:i, control:0});
+ coll.insert({_id: i, control: 0});
+ coll2.insert({_id: i, control: 0});
}
debug("Inserted docs, now split chunks");
-adminSA.runCommand( { split: ns, find : { _id : 3} });
-adminSA.runCommand( { movechunk: ns, find : { _id : 10}, to: "shard0001" });
+adminSA.runCommand({split: ns, find: {_id: 3}});
+adminSA.runCommand({movechunk: ns, find: {_id: 10}, to: "shard0001"});
var command = 'printjson(db.coll.update({ _id: 9 }, { $set: { a: "9" }}, true));';
// without this first query through mongo, the second time doesn't "fail"
debug("Try query first time");
-runMongoProgram( "mongo", "--quiet", "--port", "" + s._mongos[1].port, "--eval", command );
+runMongoProgram("mongo", "--quiet", "--port", "" + s._mongos[1].port, "--eval", command);
-var res = mongosB.getDB("test").coll2.update({ _id: 0 }, { $set: { c: "333" }});
-assert.eq( 0, res.nModified );
+var res = mongosB.getDB("test").coll2.update({_id: 0}, {$set: {c: "333"}});
+assert.eq(0, res.nModified);
s.stop();