diff options
author | Aaron <aaron@10gen.com> | 2010-06-01 12:36:34 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2010-06-01 12:36:34 -0700 |
commit | 0b0fd9cd61a31a600534f563dc03574b76ac033c (patch) | |
tree | 6df8bb78b1f313f2827a00b6cdb0cd56b328bcde /db/matcher_covered.cpp | |
parent | e40db913fc43fa3eff61099ed312c1391b4cea9b (diff) | |
download | mongo-0b0fd9cd61a31a600534f563dc03574b76ac033c.tar.gz |
SERVER-109 construct index matcher from full doc matcher
Diffstat (limited to 'db/matcher_covered.cpp')
-rw-r--r-- | db/matcher_covered.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/db/matcher_covered.cpp b/db/matcher_covered.cpp index a0c49eada59..250af7239af 100644 --- a/db/matcher_covered.cpp +++ b/db/matcher_covered.cpp @@ -32,14 +32,13 @@ namespace mongo { CoveredIndexMatcher::CoveredIndexMatcher(const BSONObj &jsobj, const BSONObj &indexKeyPattern, bool alwaysUseRecord) : - _keyMatcher(jsobj.filterFieldsUndotted(indexKeyPattern, true), - indexKeyPattern), - _docMatcher(jsobj) + _docMatcher(jsobj), + _keyMatcher(_docMatcher, indexKeyPattern) { _needRecord = alwaysUseRecord || ! ( _docMatcher.keyMatch() && - _keyMatcher.jsobj.nFields() == _docMatcher.jsobj.nFields() && + _keyMatcher.sameCriteriaCount( _docMatcher ) && ! _keyMatcher.hasType( BSONObj::opEXISTS ) ); ; @@ -53,11 +52,11 @@ namespace mongo { if ( details ) details->reset(); - if ( _keyMatcher.keyMatch() ) { +// if ( _keyMatcher.keyMatch() ) { if ( !_keyMatcher.matches(key, details ) ){ return false; } - } +// } if ( ! _needRecord ){ return true; |