diff options
Diffstat (limited to 'jstests/core/update_arraymatch6.js')
-rw-r--r-- | jstests/core/update_arraymatch6.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/core/update_arraymatch6.js b/jstests/core/update_arraymatch6.js index 71e443fa44f..fe4b09de8a0 100644 --- a/jstests/core/update_arraymatch6.js +++ b/jstests/core/update_arraymatch6.js @@ -3,13 +3,13 @@ t = db.jstests_update_arraymatch6; t.drop(); function doTest() { - t.save( {a: [{id: 1, x: [5,6,7]}, {id: 2, x: [8,9,10]}]} ); - res = t.update({'a.id': 1}, {$set: {'a.$.x': [1,1,1]}}); - assert.writeOK( res ); - assert.eq.automsg( "1", "t.findOne().a[ 0 ].x[ 0 ]" ); + t.save({a: [{id: 1, x: [5, 6, 7]}, {id: 2, x: [8, 9, 10]}]}); + res = t.update({'a.id': 1}, {$set: {'a.$.x': [1, 1, 1]}}); + assert.writeOK(res); + assert.eq.automsg("1", "t.findOne().a[ 0 ].x[ 0 ]"); } doTest(); t.drop(); -t.ensureIndex( { 'a.id':1 } ); +t.ensureIndex({'a.id': 1}); doTest();
\ No newline at end of file |