summaryrefslogtreecommitdiff
path: root/jstests/updatek.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/updatek.js')
-rw-r--r--jstests/updatek.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/jstests/updatek.js b/jstests/updatek.js
index 0c6c848ab16..b96f3138a81 100644
--- a/jstests/updatek.js
+++ b/jstests/updatek.js
@@ -5,12 +5,10 @@ t = db.jstests_updatek;
t.drop();
t.save( { _id:0, '1':{}, '01':{} } );
t.update( {}, { $set:{ '1.b':1, '1.c':2 } } );
-// 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()) );
+assert.docEq( { "01" : { }, "1" : { "b" : 1, "c" : 2 }, "_id" : 0 }, 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 }", tojson(t.findOne()) );
+assert.docEq( { "01" : { "c" : 2 }, "1" : { "b" : 1 }, "_id" : 0 }, t.findOne() );