summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression.cpp
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2019-02-25 10:14:09 -0500
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2019-03-01 10:02:45 -0500
commitadf8b17dd18bd0332a935e27eace73fc825982a3 (patch)
treee6c69c7d9afa991f5b6414d125b8d981d55a77d0 /src/mongo/db/matcher/expression.cpp
parentea8c9655768b0d482f71a44c1760600d8319bf61 (diff)
downloadmongo-adf8b17dd18bd0332a935e27eace73fc825982a3.tar.gz
SERVER-39233 Add the ability to modify the RHS element of a parsed MatchExpression
Diffstat (limited to 'src/mongo/db/matcher/expression.cpp')
-rw-r--r--src/mongo/db/matcher/expression.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/matcher/expression.cpp b/src/mongo/db/matcher/expression.cpp
index b3117dcb208..35bee13f151 100644
--- a/src/mongo/db/matcher/expression.cpp
+++ b/src/mongo/db/matcher/expression.cpp
@@ -45,9 +45,9 @@ using std::string;
MatchExpression::MatchExpression(MatchType type) : _matchType(type) {}
string MatchExpression::toString() const {
- StringBuilder buf;
- debugString(buf, 0);
- return buf.str();
+ BSONObjBuilder bob;
+ serialize(&bob);
+ return bob.obj().toString();
}
void MatchExpression::_debugAddSpace(StringBuilder& debug, int level) const {