diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/pipeline/expression.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h index fa59e89ecf2..7a2a2b139ee 100644 --- a/src/mongo/db/pipeline/expression.h +++ b/src/mongo/db/pipeline/expression.h @@ -2827,7 +2827,10 @@ public: } bool isCommutative() const final { - return true; + // Only commutative when performing binary string comparison. The first value entered when + // multiple collation-equal but binary-unequal values are added will dictate what is stored + // in the set. + return getExpressionContext()->getCollator() == nullptr; } void acceptVisitor(ExpressionMutableVisitor* visitor) final { |