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/core/mr_undef.js | |
parent | a025d43f3ce2efc1fb1282a718f5d286fa0a4dc1 (diff) | |
download | mongo-4ae691e8edc87d0e3cfb633bb91c328426be007b.tar.gz |
SERVER-22468 Format JS code with approved style in jstests/
Diffstat (limited to 'jstests/core/mr_undef.js')
-rw-r--r-- | jstests/core/mr_undef.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/jstests/core/mr_undef.js b/jstests/core/mr_undef.js index 1bf89e3acc2..de3b61543d7 100644 --- a/jstests/core/mr_undef.js +++ b/jstests/core/mr_undef.js @@ -6,17 +6,23 @@ outname = "mr_undef_out"; out = db[outname]; out.drop(); -t.insert({x : 0}); +t.insert({x: 0}); -var m = function() { emit(this.mod, this.x); }; -var r = function(k,v) { total = 0; for(i in v) { total+= v[i]; } return total; }; +var m = function() { + emit(this.mod, this.x); +}; +var r = function(k, v) { + total = 0; + for (i in v) { + total += v[i]; + } + return total; +}; -res = t.mapReduce(m, r, {out : outname } ); +res = t.mapReduce(m, r, {out: outname}); -assert.eq( 0 , out.find( { _id : { $type : 6 } } ).itcount() , "A1" ); -assert.eq( 1 , out.find( { _id : { $type : 10 } } ).itcount() , "A2" ); +assert.eq(0, out.find({_id: {$type: 6}}).itcount(), "A1"); +assert.eq(1, out.find({_id: {$type: 10}}).itcount(), "A2"); x = out.findOne(); -assert.eq( x , out.findOne( { _id : x["_id"] } ) , "A3" ); - - +assert.eq(x, out.findOne({_id: x["_id"]}), "A3"); |