summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression_expr.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
commit959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch)
treeacc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/db/matcher/expression_expr.cpp
parent76588293975fc059cf076779e4283e6ffaf8afff (diff)
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/db/matcher/expression_expr.cpp')
-rw-r--r--src/mongo/db/matcher/expression_expr.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/matcher/expression_expr.cpp b/src/mongo/db/matcher/expression_expr.cpp
index fa9faa3c2c9..1ce4f0f6954 100644
--- a/src/mongo/db/matcher/expression_expr.cpp
+++ b/src/mongo/db/matcher/expression_expr.cpp
@@ -77,8 +77,10 @@ Value ExprMatchExpression::evaluateExpression(const MatchableDocument* doc) cons
return _expression->evaluate(document, &variables);
}
-void ExprMatchExpression::serialize(BSONObjBuilder* out, bool includePath) const {
- *out << "$expr" << _expression->serialize(false);
+void ExprMatchExpression::serialize(BSONObjBuilder* out,
+ const SerializationOptions& opts,
+ bool includePath) const {
+ *out << "$expr" << _expression->serialize(opts);
}
bool ExprMatchExpression::equivalent(const MatchExpression* other) const {
@@ -94,8 +96,8 @@ bool ExprMatchExpression::equivalent(const MatchExpression* other) const {
}
// TODO SERVER-30982: Add mechanism to allow for checking Expression equivalency.
- return ValueComparator().evaluate(_expression->serialize(false) ==
- realOther->_expression->serialize(false));
+ return ValueComparator().evaluate(_expression->serialize() ==
+ realOther->_expression->serialize());
}
void ExprMatchExpression::_doSetCollator(const CollatorInterface* collator) {
@@ -114,7 +116,7 @@ void ExprMatchExpression::_doSetCollator(const CollatorInterface* collator) {
std::unique_ptr<MatchExpression> ExprMatchExpression::shallowClone() const {
// TODO SERVER-31003: Replace Expression clone via serialization with Expression::clone().
BSONObjBuilder bob;
- bob << "" << _expression->serialize(false);
+ bob << "" << _expression->serialize();
boost::intrusive_ptr<Expression> clonedExpr = Expression::parseOperand(
_expCtx.get(), bob.obj().firstElement(), _expCtx->variablesParseState);