Permalink
Browse files

was missing a Client::Context in findAndModify SERVER-6284

  • Loading branch information...
1 parent 825da30 commit 61e1be3e06600312da878c63ac72bb8bc9ac9b8b @erh erh committed Jul 3, 2012
Showing with 12 additions and 1 deletion.
  1. +10 −0 jstests/find_and_modify_where.js
  2. +2 −1 src/mongo/db/commands/find_and_modify.cpp
@@ -0,0 +1,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 )
+
@@ -111,7 +111,8 @@ namespace mongo {
Lock::DBWrite lk( ns );
-
+ Client::Context cx( ns );
+
BSONObj doc;
bool found = Helpers::findOne( ns.c_str() , query , doc );

0 comments on commit 61e1be3

Please sign in to comment.