summaryrefslogtreecommitdiff
path: root/jstests/core/find_and_modify_where.js
blob: 2092dc5566f8f1124d1d0afc64d9b7739d1cbc34 (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 )