summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h')
-rw-r--r--src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h b/src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h
index a6c063f9244..05519e17ff3 100644
--- a/src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h
+++ b/src/mongo/db/matcher/schema/expression_internal_schema_match_array_index.h
@@ -45,7 +45,10 @@ public:
static constexpr StringData kName = "$_internalSchemaMatchArrayIndex"_sd;
InternalSchemaMatchArrayIndexMatchExpression(
- StringData path, long long index, std::unique_ptr<ExpressionWithPlaceholder> expression);
+ StringData path,
+ long long index,
+ std::unique_ptr<ExpressionWithPlaceholder> expression,
+ clonable_ptr<ErrorAnnotation> annotation = nullptr);
void debugString(StringBuilder& debug, int indentationLevel) const final;
@@ -94,6 +97,13 @@ public:
visitor->visit(this);
}
+ /**
+ * Returns an index of an array element this expression applies to.
+ */
+ long long arrayIndex() const {
+ return _index;
+ }
+
private:
ExpressionOptimizerFunc getOptimizer() const final;