diff options
Diffstat (limited to 'db/matcher.h')
-rw-r--r-- | db/matcher.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/db/matcher.h b/db/matcher.h index c814fe3c2cb..03b5b335845 100644 --- a/db/matcher.h +++ b/db/matcher.h @@ -57,9 +57,17 @@ namespace mongo { } BasicMatcher( BSONElement _e , int _op ) : toMatch( _e ) , compareOp( _op ){ + if ( _op == BSONObj::opMOD ){ + BSONObj o = _e.embeddedObject().firstElement().embeddedObject(); + mod = o["0"].numberInt(); + modm = o["1"].numberInt(); + + uassert( "mod can't be 0" , mod ); + uassert( "mod eq can't be 0" , modm ); + } } - + BasicMatcher( BSONElement _e , int _op , const BSONObj& array ) : toMatch( _e ) , compareOp( _op ){ myset.reset( new set<BSONElement,element_lt>() ); @@ -74,6 +82,9 @@ namespace mongo { BSONElement toMatch; int compareOp; shared_ptr< set<BSONElement,element_lt> > myset; + + int mod; + int modm; }; // SQL where clause equivalent |