From 20a22bdf907a0e2cd60b79f242a7375d84a3ab6a Mon Sep 17 00:00:00 2001 From: David Storch Date: Wed, 5 Mar 2014 10:22:05 -0500 Subject: SERVER-13038 verbose query logging cleanup --- src/mongo/db/matcher/expression_leaf.cpp | 19 ++++++++++++++++++- src/mongo/db/matcher/expression_leaf.h | 4 ++++ src/mongo/db/matcher/expression_text.cpp | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/matcher') diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp index 7e26569f4c8..68002636fbc 100644 --- a/src/mongo/db/matcher/expression_leaf.cpp +++ b/src/mongo/db/matcher/expression_leaf.cpp @@ -240,6 +240,10 @@ namespace mongo { debug << "\n"; } + void RegexMatchExpression::shortDebugString( StringBuilder& debug ) const { + debug << "/" << _regex << "/" << _flags; + } + // --------- Status ModMatchExpression::init( const StringData& path, int divisor, int remainder ) { @@ -433,6 +437,18 @@ namespace mongo { toFillIn._regexes.push_back( static_cast(_regexes[i]->shallowClone()) ); } + void ArrayFilterEntries::debugString( StringBuilder& debug ) const { + debug << "[ "; + for (BSONElementSet::const_iterator it = _equalities.begin(); + it != _equalities.end(); ++it) { + debug << it->toString( false ) << " "; + } + for (size_t i = 0; i < _regexes.size(); ++i) { + _regexes[i]->shortDebugString( debug ); + debug << " "; + } + debug << "]"; + } // ----------- @@ -475,7 +491,8 @@ namespace mongo { void InMatchExpression::debugString( StringBuilder& debug, int level ) const { _debugAddSpace( debug, level ); - debug << path() << ";$in: TODO "; + debug << path() << " $in "; + _arrayEntries.debugString(debug); MatchExpression::TagData* td = getTag(); if (NULL != td) { debug << " "; diff --git a/src/mongo/db/matcher/expression_leaf.h b/src/mongo/db/matcher/expression_leaf.h index 29b346bb738..b7d88d06d14 100644 --- a/src/mongo/db/matcher/expression_leaf.h +++ b/src/mongo/db/matcher/expression_leaf.h @@ -204,6 +204,8 @@ namespace mongo { virtual void debugString( StringBuilder& debug, int level ) const; + void shortDebugString( StringBuilder& debug ) const; + virtual bool equivalent( const MatchExpression* other ) const; const string& getString() const { return _regex; } @@ -296,6 +298,8 @@ namespace mongo { void copyTo( ArrayFilterEntries& toFillIn ) const; + void debugString( StringBuilder& debug ) const; + private: bool _hasNull; // if _equalities has a jstNULL element in it bool _hasEmptyArray; diff --git a/src/mongo/db/matcher/expression_text.cpp b/src/mongo/db/matcher/expression_text.cpp index 1a66a395946..f81c3dc1fa3 100644 --- a/src/mongo/db/matcher/expression_text.cpp +++ b/src/mongo/db/matcher/expression_text.cpp @@ -48,7 +48,7 @@ namespace mongo { void TextMatchExpression::debugString( StringBuilder& debug, int level ) const { _debugAddSpace(debug, level); - debug << "TEXT : query=" << _query << ", language = " << _language << ", tag="; + debug << "TEXT : query=" << _query << ", language=" << _language << ", tag="; MatchExpression::TagData* td = getTag(); if ( NULL != td ) { td->debugString( &debug ); -- cgit v1.2.1