diff options
author | Eliot Horowitz <eliot@10gen.com> | 2013-05-08 10:26:44 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2013-05-09 10:16:55 -0400 |
commit | 3893e7ff97d576652756456fafba2936092e15ce (patch) | |
tree | 124d77e989e9bad3264b4111e0570aead5df23a8 /src/mongo/db/matcher/expression_where.cpp | |
parent | f41cc12bf4672528f513fb81f1fab4b4b379ae83 (diff) | |
download | mongo-3893e7ff97d576652756456fafba2936092e15ce.tar.gz |
SERVER-6400 Use an abstraction layer into MatchExpression for different formats
currently BSONObj vs index keys
Diffstat (limited to 'src/mongo/db/matcher/expression_where.cpp')
-rw-r--r-- | src/mongo/db/matcher/expression_where.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/matcher/expression_where.cpp b/src/mongo/db/matcher/expression_where.cpp index 1bfc74107af..532f403a2ce 100644 --- a/src/mongo/db/matcher/expression_where.cpp +++ b/src/mongo/db/matcher/expression_where.cpp @@ -34,7 +34,7 @@ namespace mongo { Status init( const StringData& ns, const StringData& theCode, const BSONObj& scope ); - virtual bool matches( const BSONObj& doc, MatchDetails* details = 0 ) const; + virtual bool matches( const MatchableDocument* doc, MatchDetails* details = 0 ) const; virtual bool matchesSingleElement( const BSONElement& e ) const { return false; @@ -76,8 +76,9 @@ namespace mongo { return Status::OK(); } - bool WhereMatchExpression::matches( const BSONObj& obj, MatchDetails* details ) const { + bool WhereMatchExpression::matches( const MatchableDocument* doc, MatchDetails* details ) const { verify( _func ); + BSONObj obj = doc->toBSON(); if ( ! _userScope.isEmpty() ) { _scope->init( &_userScope ); |