summaryrefslogtreecommitdiff
path: root/jstests/updatea.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-28 15:45:29 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-28 15:45:29 -0500
commit95137f262c2a57831dccf058428a2f64e900496e (patch)
tree3b24966258ad7803330f02ba2eab92469bff9cb2 /jstests/updatea.js
parent0a71e870ced185119b233e941d99bf363cae92cb (diff)
downloadmongo-95137f262c2a57831dccf058428a2f64e900496e.tar.gz
more tests for SERVER-181
Diffstat (limited to 'jstests/updatea.js')
-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]++;
+