blob: fe13a6894fdfef1ad6154a3f5600a531ecba33c6 (
plain)
1
2
3
4
5
6
7
8
9
10
|
t = db.find_and_modify_where;
t.drop();
t.insert( { _id : 1 , x : 1 } );
res = t.findAndModify( { query : { $where : "return this.x == 1" } , update : { $set : { y : 1 } } } );
assert.eq( 1 , t.findOne().y );
|