summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-03-05 10:22:05 -0500
committerDavid Storch <david.storch@10gen.com>2014-03-07 17:08:01 -0500
commit20a22bdf907a0e2cd60b79f242a7375d84a3ab6a (patch)
treeb6544d991e0514c2eca34fa7ee37def1cc129ebf /src/mongo/db/matcher
parent765409253203229a2c3577d1d8a3964f7a0d1554 (diff)
downloadmongo-20a22bdf907a0e2cd60b79f242a7375d84a3ab6a.tar.gz
SERVER-13038 verbose query logging cleanup
Diffstat (limited to 'src/mongo/db/matcher')
-rw-r--r--src/mongo/db/matcher/expression_leaf.cpp19
-rw-r--r--src/mongo/db/matcher/expression_leaf.h4
-rw-r--r--src/mongo/db/matcher/expression_text.cpp2
3 files changed, 23 insertions, 2 deletions
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<RegexMatchExpression*>(_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 );