Files
mongo/jstests/core/server5346.js
Siyuan Zhou 3660343e0b SERVER-12127 migrate js tests to jscore suite when not related to writes
Migrate js tests starting from j-z.
Include SERVER-12920 Update use_power_of_2.js

Signed-off-by: Matt Kangas <matt.kangas@mongodb.com>
2014-03-03 22:54:10 -05:00

16 lines
487 B
JavaScript

t = db.server5346;
t.drop();
x = { _id : 1 , versions : {} }
t.insert( x )
t.update({ _id : 1 }, { $inc : { "versions.2_01" : 1 } } )
t.update({ _id : 1 }, { $inc : { "versions.2_1" : 2 } } )
t.update({ _id : 1 }, { $inc : { "versions.01" : 3 } } )
t.update({ _id : 1 }, { $inc : { "versions.1" : 4 } } )
// Make sure the correct fields are set, without duplicates.
assert.docEq( { "_id" : 1, "versions" : { "01" : 3, "1" : 4, "2_01" : 1, "2_1" : 2 } },
t.findOne())