Skip to content

Commit

Permalink
SERVER-5274: updatek.js failing in V8
Browse files Browse the repository at this point in the history
  • Loading branch information
agirbal committed Mar 13, 2012
1 parent 206a2db commit 825c8b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jstests/updatek.js
Expand Up @@ -5,9 +5,12 @@ t = db.jstests_updatek;
t.drop();
t.save( { _id:0, '1':{}, '01':{} } );
t.update( {}, { $set:{ '1.b':1, '1.c':2 } } );
assert.eq( { '01':{}, '1':{ b:1, c:2 }, _id:0 }, t.findOne() );
// make sure correct fields are set, with no duplicates
// must use string comparison because V8 reorders fields that are numerical in objects
assert.eq( "{ \"01\" : { }, \"1\" : { \"b\" : 1, \"c\" : 2 }, \"_id\" : 0 }", tojson(t.findOne()) );

t.drop();
t.save( { _id:0, '1':{}, '01':{} } );
t.update( {}, { $set:{ '1.b':1, '01.c':2 } } );
assert.eq( { '01':{ c:2 }, '1':{ b:1 }, _id:0 }, t.findOne() );
assert.eq( "{ \"01\" : { \"c\" : 2 }, \"1\" : { \"b\" : 1 }, \"_id\" : 0 }", tojson(t.findOne()) );

0 comments on commit 825c8b7

Please sign in to comment.