summaryrefslogtreecommitdiff
path: root/jstests/core/orp.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/core/orp.js
parenta025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff)
downloadmongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/orp.js')
-rw-r--r--jstests/core/orp.js41
1 files changed, 20 insertions, 21 deletions
diff --git a/jstests/core/orp.js b/jstests/core/orp.js
index 18abdfbc63a..a706d6f4c1a 100644
--- a/jstests/core/orp.js
+++ b/jstests/core/orp.js
@@ -4,40 +4,39 @@
t = db.jstests_orp;
t.drop();
-t.ensureIndex( { a:1 } );
-t.ensureIndex( { b:1 } );
-t.ensureIndex( { c:1 } );
+t.ensureIndex({a: 1});
+t.ensureIndex({b: 1});
+t.ensureIndex({c: 1});
-for( i = 0; i < 200; ++i ) {
- t.save( { a:1, b:1 } );
+for (i = 0; i < 200; ++i) {
+ t.save({a: 1, b: 1});
}
// Deduping results from the previous clause.
-assert.eq( 200, t.count( { $or:[ { a:1 }, { b:1 } ] } ) );
+assert.eq(200, t.count({$or: [{a: 1}, {b: 1}]}));
// Deduping results from a prior clause.
-assert.eq( 200, t.count( { $or:[ { a:1 }, { c:1 }, { b:1 } ] } ) );
-t.save( { c:1 } );
-assert.eq( 201, t.count( { $or:[ { a:1 }, { c:1 }, { b:1 } ] } ) );
+assert.eq(200, t.count({$or: [{a: 1}, {c: 1}, {b: 1}]}));
+t.save({c: 1});
+assert.eq(201, t.count({$or: [{a: 1}, {c: 1}, {b: 1}]}));
// Deduping results that would normally be index only matches on overlapping and double scanned $or
// field regions.
t.drop();
-t.ensureIndex( { a:1, b:1 } );
-for( i = 0; i < 16; ++i ) {
- for( j = 0; j < 16; ++j ) {
- t.save( { a:i, b:j } );
+t.ensureIndex({a: 1, b: 1});
+for (i = 0; i < 16; ++i) {
+ for (j = 0; j < 16; ++j) {
+ t.save({a: i, b: j});
}
}
-assert.eq( 16 * 16,
- t.count( { $or:[ { a:{ $gte:0 }, b:{ $gte:0 } }, { a:{ $lte:16 }, b:{ $lte:16 } } ] } ) );
+assert.eq(16 * 16, t.count({$or: [{a: {$gte: 0}, b: {$gte: 0}}, {a: {$lte: 16}, b: {$lte: 16}}]}));
// Deduping results from a clause that completed before the multi cursor takeover.
t.drop();
-t.ensureIndex( { a:1 } );
-t.ensureIndex( { b:1 } );
-t.save( { a:1,b:200 } );
-for( i = 0; i < 200; ++i ) {
- t.save( { b:i } );
+t.ensureIndex({a: 1});
+t.ensureIndex({b: 1});
+t.save({a: 1, b: 200});
+for (i = 0; i < 200; ++i) {
+ t.save({b: i});
}
-assert.eq( 201, t.count( { $or:[ { a:1 }, { b:{ $gte:0 } } ] } ) );
+assert.eq(201, t.count({$or: [{a: 1}, {b: {$gte: 0}}]}));