summaryrefslogtreecommitdiff
path: root/jstests/parallel/update_serializability1.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/parallel/update_serializability1.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/parallel/update_serializability1.js')
-rw-r--r--jstests/parallel/update_serializability1.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/jstests/parallel/update_serializability1.js b/jstests/parallel/update_serializability1.js
index 55fc119101d..6fc41204c3c 100644
--- a/jstests/parallel/update_serializability1.js
+++ b/jstests/parallel/update_serializability1.js
@@ -5,23 +5,25 @@ t.drop();
N = 100000;
bulk = t.initializeUnorderedBulkOp();
-for ( var i = 0; i < N; i++ ) {
- bulk.insert( { _id : i, a : i, b: N-i, x : 1, y : 1 } );
+for (var i = 0; i < N; i++) {
+ bulk.insert({_id: i, a: i, b: N - i, x: 1, y: 1});
}
bulk.execute();
-t.ensureIndex( { a : 1 } );
-t.ensureIndex( { b : 1 } );
+t.ensureIndex({a: 1});
+t.ensureIndex({b: 1});
-s1 = startParallelShell( "db.update_serializability1.update( { a : { $gte : 0 } }, { $set : { b : " + (N+1) + ", x : 2 } }, false, true );" );
-s2 = startParallelShell( "db.update_serializability1.update( { b : { $lte : " + N + " } }, { $set : { a : -1, y : 2 } }, false, true );" );
+s1 = startParallelShell("db.update_serializability1.update( { a : { $gte : 0 } }, { $set : { b : " +
+ (N + 1) + ", x : 2 } }, false, true );");
+s2 = startParallelShell("db.update_serializability1.update( { b : { $lte : " + N +
+ " } }, { $set : { a : -1, y : 2 } }, false, true );");
s1();
s2();
// some of each type should have gotten done
-assert( t.find( { x : 2 } ).count() > 0 );
-assert( t.find( { y : 2 } ).count() > 0 );
+assert(t.find({x: 2}).count() > 0);
+assert(t.find({y: 2}).count() > 0);
// both operations should never happen on a document
-assert.eq( 0, t.find( { x : 2, y : 2 } ).count() );
+assert.eq(0, t.find({x: 2, y: 2}).count());