diff options
Diffstat (limited to 'db/matcher.cpp')
-rw-r--r-- | db/matcher.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/db/matcher.cpp b/db/matcher.cpp index 23d5a7057bf..2b92d5797c3 100644 --- a/db/matcher.cpp +++ b/db/matcher.cpp @@ -64,8 +64,14 @@ namespace mongo { } ~Where() { - if ( scope.get() ) - scope->execSetup( "_mongo.readOnly = false;" , "make not read only" ); + if ( scope.get() ){ + try { + scope->execSetup( "_mongo.readOnly = false;" , "make not read only" ); + } + catch( DBException& e ){ + warning() << "javascript scope cleanup interrupted" << causedBy( e ) << endl; + } + } if ( jsScope ) { delete jsScope; @@ -148,6 +154,9 @@ namespace mongo { rm._prefix = prefix; } else { + uassert( 15882, "$elemMatch not allowed within $in", + ie.type() != Object || + ie.embeddedObject().firstElement().getGtLtOp() != BSONObj::opELEM_MATCH ); _myset->insert(ie); } } |