0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00
This commit is contained in:
Eliot Horowitz 2009-12-28 15:45:29 -05:00
parent 0a71e870ce
commit 95137f262c

View File

@ -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]++;