Permalink
Browse files

can put $comment in normal query SERVER-3789

  • Loading branch information...
1 parent 357f336 commit 33bda54e9aa42690ebfd312bc164f8b613327e54 @erh erh committed Sep 21, 2011
Showing with 6 additions and 0 deletions.
  1. +3 −0 db/matcher.cpp
  2. +3 −0 jstests/query1.js
View
@@ -322,6 +322,9 @@ namespace mongo {
else if ( ef[ 1 ] == 'n' && ef[ 2 ] == 'o' && ef[ 3 ] == 'r' && ef[ 4 ] == 0 ) {
parseExtractedClause( e, _norMatchers );
}
+ else if ( ef[ 1 ] == 'c' && ef[ 2 ] == 'o' && ef[ 3 ] == 'm' && str::equals( ef , "$comment" ) ) {
+ // $comment is a noop
+ }
else {
return false;
}
View
@@ -21,3 +21,6 @@ assert.eq( total , 8 , "total" )
assert.eq( 3 , t.find()._addSpecial( "$comment" , "this is a test" ).itcount() , "B1" )
assert.eq( 3 , t.find()._addSpecial( "$comment" , "this is a test" ).count() , "B2" )
+
+assert.eq( 3 , t.find( { "$comment" : "yo ho ho" } ).itcount() , "C1" )
+assert.eq( 3 , t.find( { "$comment" : "this is a test" } ).count() , "C2" )

0 comments on commit 33bda54

Please sign in to comment.