0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

test file

This commit is contained in:
dwight 2010-03-07 20:55:14 -05:00
parent 7f75c1b5f7
commit bc5ea71d55

17
jstests/tilde.js Normal file
View File

@ -0,0 +1,17 @@
t = db.tilde;
t.drop();
print("Part 2");
t.insert( { } );
t.insert( { x : [1,2,3] } );
t.insert( { x : 99 } );
t.update( {x : 2}, { $inc : { "~" : 1 } } , false, true );
//assert( t.findOne({x:1}).x[1] == 3, "tilde broken?" );
printjson( t.findOne({x:1}) );
print("Part 2");
t.insert( { x : { y : [8,7,6] } } )
t.update( {'x.y' : 7}, { $inc : { "x.~" : 1 } } , false, true )
printjson( t.findOne({"x.y" : 8}) );
// assert( t.findOne({"x.y" : 8}).x.y[1] == 8, "tilde nested" );