summaryrefslogtreecommitdiff
path: root/jstests/core/nestedobj1.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/nestedobj1.js')
-rw-r--r--jstests/core/nestedobj1.js26
1 files changed, 15 insertions, 11 deletions
diff --git a/jstests/core/nestedobj1.js b/jstests/core/nestedobj1.js
index 45ef0c530d4..97b9460da6f 100644
--- a/jstests/core/nestedobj1.js
+++ b/jstests/core/nestedobj1.js
@@ -1,10 +1,14 @@
-//SERVER-5127, SERVER-5036
+// SERVER-5127, SERVER-5036
-function makeNestObj(depth){
- toret = { a : 1};
+function makeNestObj(depth) {
+ toret = {
+ a: 1
+ };
- for(i = 1; i < depth; i++){
- toret = {a : toret};
+ for (i = 1; i < depth; i++) {
+ toret = {
+ a: toret
+ };
}
return toret;
@@ -13,18 +17,18 @@ function makeNestObj(depth){
t = db.objNestTest;
t.drop();
-t.ensureIndex({a:1});
+t.ensureIndex({a: 1});
n = 1;
-while ( true ) {
+while (true) {
var before = t.count();
- t.insert( { _id : n, a : makeNestObj(n) } );
+ t.insert({_id: n, a: makeNestObj(n)});
var after = t.count();
- if ( before == after )
+ if (before == after)
break;
n++;
}
-assert( n > 30, "not enough n: " + n );
+assert(n > 30, "not enough n: " + n);
-assert.eq( t.count(), t.find( { _id : { $gt : 0 } } ).hint( { a : 1 } ).itcount() );
+assert.eq(t.count(), t.find({_id: {$gt: 0}}).hint({a: 1}).itcount());