summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorKatherine Wu <katherine.wu@mongodb.com>2020-06-11 20:26:35 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-12 01:49:40 +0000
commit1b9ebaabbcd6d15ba8548545e2b633dac3420f96 (patch)
treec9fb276a2ad8f8a11b33cb2958448a4e09552a31 /src/mongo/db/query
parent01f7c7a2e39c1c555347e23a28a7a6e8357ab5f2 (diff)
downloadmongo-1b9ebaabbcd6d15ba8548545e2b633dac3420f96.tar.gz
SERVER-46718 Support 'let' parameters for findAndModify in sharded environments
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/canonical_query.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/query/canonical_query.cpp b/src/mongo/db/query/canonical_query.cpp
index 8afbb78ddb1..5c4fbbc4b34 100644
--- a/src/mongo/db/query/canonical_query.cpp
+++ b/src/mongo/db/query/canonical_query.cpp
@@ -109,7 +109,9 @@ StatusWith<std::unique_ptr<CanonicalQuery>> CanonicalQuery::canonicalize(
// A collator can enter through both the QueryRequest and ExpressionContext arguments.
// This invariant ensures that both collators are the same because downstream we
// pull the collator from only one of the ExpressionContext carrier.
- invariant(CollatorInterface::collatorsMatch(collator.get(), expCtx->getCollator()));
+ if (collator.get() && expCtx->getCollator()) {
+ invariant(CollatorInterface::collatorsMatch(collator.get(), expCtx->getCollator()));
+ }
}
StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(