mongo-debian/jstests/update8.js
2010-01-31 08:32:52 +01:00

11 lines
280 B
JavaScript

t = db.update8;
t.drop();
t.update( { _id : 1 , tags: {"$ne": "a"}}, {"$push": { tags : "a" } } , true )
assert.eq( { _id : 1 , tags : [ "a" ] } , t.findOne() , "A" );
t.drop()
//SERVER-390
//t.update( { "x.y" : 1 } , { $inc : { i : 1 } } , true );
//printjson( t.findOne() );