diff options
Diffstat (limited to 'src/mongo/db/matcher/schema/expression_internal_schema_min_length.h')
-rw-r--r-- | src/mongo/db/matcher/schema/expression_internal_schema_min_length.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/db/matcher/schema/expression_internal_schema_min_length.h b/src/mongo/db/matcher/schema/expression_internal_schema_min_length.h index eb26bac606b..d7c4b8aa06b 100644 --- a/src/mongo/db/matcher/schema/expression_internal_schema_min_length.h +++ b/src/mongo/db/matcher/schema/expression_internal_schema_min_length.h @@ -37,10 +37,14 @@ namespace mongo { class InternalSchemaMinLengthMatchExpression final : public InternalSchemaStrLengthMatchExpression { public: - InternalSchemaMinLengthMatchExpression(StringData path, long long strLen) - : InternalSchemaStrLengthMatchExpression( - MatchType::INTERNAL_SCHEMA_MIN_LENGTH, path, strLen, "$_internalSchemaMinLength"_sd) { - } + InternalSchemaMinLengthMatchExpression(StringData path, + long long strLen, + clonable_ptr<ErrorAnnotation> annotation = nullptr) + : InternalSchemaStrLengthMatchExpression(MatchType::INTERNAL_SCHEMA_MIN_LENGTH, + path, + strLen, + "$_internalSchemaMinLength"_sd, + std::move(annotation)) {} Validator getComparator() const final { return [strLen = strLen()](int lenWithoutNullTerm) { return lenWithoutNullTerm >= strLen; }; @@ -48,7 +52,8 @@ public: std::unique_ptr<MatchExpression> shallowClone() const final { std::unique_ptr<InternalSchemaMinLengthMatchExpression> minLen = - std::make_unique<InternalSchemaMinLengthMatchExpression>(path(), strLen()); + std::make_unique<InternalSchemaMinLengthMatchExpression>( + path(), strLen(), _errorAnnotation); if (getTag()) { minLen->setTag(getTag()->clone()); } |