summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression_where.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-05-08 10:26:44 -0400
committerEliot Horowitz <eliot@10gen.com>2013-05-09 10:16:55 -0400
commit3893e7ff97d576652756456fafba2936092e15ce (patch)
tree124d77e989e9bad3264b4111e0570aead5df23a8 /src/mongo/db/matcher/expression_where.cpp
parentf41cc12bf4672528f513fb81f1fab4b4b379ae83 (diff)
downloadmongo-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.cpp5
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 );