diff --git a/packages/mql-typescript/mql-specifications b/packages/mql-typescript/mql-specifications index 060a5748..5b4e8630 160000 --- a/packages/mql-typescript/mql-specifications +++ b/packages/mql-typescript/mql-specifications @@ -1 +1 @@ -Subproject commit 060a5748705507b9765055a762bd7c4cb14d793f +Subproject commit 5b4e8630d5e8a794978b9f4004840f104377a7a9 diff --git a/packages/mql-typescript/out/schema.d.ts b/packages/mql-typescript/out/schema.d.ts index 1beedfb1..c8d8ece5 100644 --- a/packages/mql-typescript/out/schema.d.ts +++ b/packages/mql-typescript/out/schema.d.ts @@ -1793,14 +1793,20 @@ export namespace Aggregation.Expression { input: ResolvesToArray; /** - * An expression that resolves to a boolean value used to determine if an element should be included in the output array. The expression references each element of the input array individually with the variable name specified in as. + * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this. */ - cond: ResolvesToBool; + as?: string; /** - * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this. + * A name for the variable that represents the index of the current element in + * the input array. If specified, this variable is available within the cond expression. */ - as?: string; + arrayIndexAs?: string; + + /** + * An expression that resolves to a boolean value used to determine if an element should be included in the output array. The expression references each element of the input array individually with the variable name specified in as, and the element index with the variable name specified in arrayIndexAs (MongoDB 8.3+). + */ + cond: ResolvesToBool; /** * A number expression that restricts the number of matching array elements that $filter returns. You cannot specify a limit less than 1. The matching array elements are returned in the order they appear in the input array. @@ -2859,19 +2865,19 @@ export namespace Aggregation.Expression { /** * A valid expression that $reduce applies to each element in the input array in left-to-right order. Wrap the input value with $reverseArray to yield the equivalent of applying the combining expression from right-to-left. * During evaluation of the in expression, two variables will be available: - * - value is the variable that represents the cumulative value of the expression. - * - this is the variable that refers to the element being processed. + * - value is the variable that represents the cumulative value of the expression. Use valueAs (MongoDB 8.3+) to specify a custom name. + * - this is the variable that refers to the element being processed. Use as (MongoDB 8.3+) to specify a custom name. */ in: | Expression< S & { /** - * The variable that refers to the element being processed. + * The variable that refers to the element being processed. Renamed via the as argument (MongoDB 8.3+). */ $this: any; /** - * The variable that represents the cumulative value of the expression. + * The variable that represents the cumulative value of the expression. Renamed via the valueAs argument (MongoDB 8.3+). */ $value: any; } @@ -2879,16 +2885,34 @@ export namespace Aggregation.Expression { | ExpressionMap< S & { /** - * The variable that refers to the element being processed. + * The variable that refers to the element being processed. Renamed via the as argument (MongoDB 8.3+). */ $this: any; /** - * The variable that represents the cumulative value of the expression. + * The variable that represents the cumulative value of the expression. Renamed via the valueAs argument (MongoDB 8.3+). */ $value: any; } >; + + /** + * A name for the variable that represents each individual element of the input array. + * If no name is specified, the variable name defaults to this. + */ + as?: string; + + /** + * A name for the variable that represents the cumulative value of the expression. + * If no name is specified, the variable name defaults to value. + */ + valueAs?: string; + + /** + * A name for the variable that represents the index of the current element in + * the input array. If specified, this variable is available within the in expression. + */ + arrayIndexAs?: string; }; }