summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/updatea.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/updatea.js b/jstests/updatea.js
index d6495d2186f..9864aa67889 100644
--- a/jstests/updatea.js
+++ b/jstests/updatea.js
@@ -30,5 +30,21 @@ orig.comments[0].rate_up++;
orig.comments[0].rate_ups.push( 99 )
assert.eq( orig , t.findOne() , "B1" )
+t.drop();
+orig = { _id : 1 , a : [] }
+for ( i=0; i<12; i++ )
+ orig.a.push( i );
+
+
+t.save( orig );
+assert.eq( orig , t.findOne() , "C1" );
+
+t.update( {} , { $inc: { "a.0" : 1 } } );
+orig.a[0]++;
+assert.eq( orig , t.findOne() , "C2" );
+
+t.update( {} , { $inc: { "a.10" : 1 } } );
+orig.a[10]++;
+