diff options
Diffstat (limited to 'src/mongo/db/matcher/expression_type.h')
-rw-r--r-- | src/mongo/db/matcher/expression_type.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/matcher/expression_type.h b/src/mongo/db/matcher/expression_type.h index 75f6155f7fa..bc2a758caf7 100644 --- a/src/mongo/db/matcher/expression_type.h +++ b/src/mongo/db/matcher/expression_type.h @@ -77,8 +77,11 @@ public: } BSONObj getSerializedRightHandSide(SerializationOptions opts) const final { - // TODO SERVER-73678 respect 'replacementForLiteralArgs'. BSONObjBuilder subBuilder; + if (opts.replacementForLiteralArgs) { + subBuilder.append(name(), opts.replacementForLiteralArgs.get()); + return subBuilder.obj(); + } BSONArrayBuilder arrBuilder(subBuilder.subarrayStart(name())); _typeSet.toBSONArray(&arrBuilder); arrBuilder.doneFast(); @@ -244,9 +247,12 @@ public: } BSONObj getSerializedRightHandSide(SerializationOptions opts) const final { - // TODO SERVER-73678 respect 'replacementForLiteralArgs'. BSONObjBuilder bob; - bob.append(name(), _binDataSubType); + if (opts.replacementForLiteralArgs) { + bob.append(name(), opts.replacementForLiteralArgs.get()); + } else { + bob.append(name(), _binDataSubType); + } return bob.obj(); } |