summaryrefslogtreecommitdiff
path: root/jstests/repl/basic1.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/repl/basic1.js')
-rw-r--r--jstests/repl/basic1.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/jstests/repl/basic1.js b/jstests/repl/basic1.js
index 594ba07643f..0af26ac2225 100644
--- a/jstests/repl/basic1.js
+++ b/jstests/repl/basic1.js
@@ -121,12 +121,30 @@ t.update( { "b" : 3} , { $set : { "b.$" : 17 } } )
block();
check( "after pos 4 " );
-
printjson( am.rpos.findOne() )
printjson( as.rpos.findOne() )
//am.getSisterDB( "local" ).getCollection( "oplog.$main" ).find().limit(10).sort( { $natural : -1 } ).forEach( printjson )
+
+t = am.b;
+t.update( { "_id" : "fun"}, { $inc : {"a.b.c.x" : 6743} } , true, false)
+block()
+check( "b 1" );
+
+t.update( { "_id" : "fun"}, { $inc : {"a.b.c.x" : 5} } , true, false)
+block()
+check( "b 2" );
+
+t.update( { "_id" : "fun"}, { $inc : {"a.b.c.x" : 100, "a.b.c.y" : 911} } , true, false)
+block()
+assert.eq( { _id : "fun" , a : { b : { c : { x : 6848 , y : 911 } } } } , as.b.findOne() , "b 3" );
+//printjson( t.findOne() )
+//printjson( as.b.findOne() )
+//am.getSisterDB( "local" ).getCollection( "oplog.$main" ).find().sort( { $natural : -1 } ).limit(3).forEach( printjson )
+check( "b 4" );
+
+
rt.stop();