File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -371,13 +371,14 @@ namespace mongo {
371371 return ;
372372 }
373373
374- if ( strcmp (e.fieldName (), " $where" )==0 ) {
374+ const char *fn = e.fieldName ();
375+ if ( str::equals (fn, " $where" ) ) {
375376 parseWhere (e);
376377 return ;
377378 }
378379
379380 if ( e.type () == RegEx ) {
380- addRegex ( e. fieldName () , e.regex (), e.regexFlags () );
381+ addRegex ( fn , e.regex (), e.regexFlags () );
381382 return ;
382383 }
383384
@@ -440,10 +441,12 @@ namespace mongo {
440441 if ( e.type () == Array ) {
441442 _hasArray = true ;
442443 }
443- else if ( strcmp (e.fieldName (), " $atomic" ) == 0 ) {
444- uassert ( 14844 , " $atomic specifier must be a top level field" , !nested );
445- _atomic = e.trueValue ();
446- return ;
444+ else if ( *fn == ' $' ) {
445+ if ( str::equals (fn, " $atomic" ) || str::equals (fn, " $isolated" ) ) {
446+ uassert ( 14844 , " $atomic specifier must be a top level field" , !nested );
447+ _atomic = e.trueValue ();
448+ return ;
449+ }
447450 }
448451
449452 // normal, simple case e.g. { a : "foo" }
You can’t perform that action at this time.
0 commit comments