@mongodb-js/mql-typescript 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/out/schema.d.ts +34 -10
  2. package/package.json +2 -2
package/out/schema.d.ts CHANGED
@@ -1793,14 +1793,20 @@ export namespace Aggregation.Expression {
1793
1793
  input: ResolvesToArray<S>;
1794
1794
 
1795
1795
  /**
1796
- * 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.
1796
+ * 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.
1797
1797
  */
1798
- cond: ResolvesToBool<S>;
1798
+ as?: string;
1799
1799
 
1800
1800
  /**
1801
- * 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.
1801
+ * A name for the variable that represents the index of the current element in
1802
+ * the input array. If specified, this variable is available within the cond expression.
1802
1803
  */
1803
- as?: string;
1804
+ arrayIndexAs?: string;
1805
+
1806
+ /**
1807
+ * 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+).
1808
+ */
1809
+ cond: ResolvesToBool<S>;
1804
1810
 
1805
1811
  /**
1806
1812
  * 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 {
2859
2865
  /**
2860
2866
  * 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.
2861
2867
  * During evaluation of the in expression, two variables will be available:
2862
- * - value is the variable that represents the cumulative value of the expression.
2863
- * - this is the variable that refers to the element being processed.
2868
+ * - value is the variable that represents the cumulative value of the expression. Use valueAs (MongoDB 8.3+) to specify a custom name.
2869
+ * - this is the variable that refers to the element being processed. Use as (MongoDB 8.3+) to specify a custom name.
2864
2870
  */
2865
2871
  in:
2866
2872
  | Expression<
2867
2873
  S & {
2868
2874
  /**
2869
- * The variable that refers to the element being processed.
2875
+ * The variable that refers to the element being processed. Renamed via the as argument (MongoDB 8.3+).
2870
2876
  */
2871
2877
  $this: any;
2872
2878
 
2873
2879
  /**
2874
- * The variable that represents the cumulative value of the expression.
2880
+ * The variable that represents the cumulative value of the expression. Renamed via the valueAs argument (MongoDB 8.3+).
2875
2881
  */
2876
2882
  $value: any;
2877
2883
  }
@@ -2879,16 +2885,34 @@ export namespace Aggregation.Expression {
2879
2885
  | ExpressionMap<
2880
2886
  S & {
2881
2887
  /**
2882
- * The variable that refers to the element being processed.
2888
+ * The variable that refers to the element being processed. Renamed via the as argument (MongoDB 8.3+).
2883
2889
  */
2884
2890
  $this: any;
2885
2891
 
2886
2892
  /**
2887
- * The variable that represents the cumulative value of the expression.
2893
+ * The variable that represents the cumulative value of the expression. Renamed via the valueAs argument (MongoDB 8.3+).
2888
2894
  */
2889
2895
  $value: any;
2890
2896
  }
2891
2897
  >;
2898
+
2899
+ /**
2900
+ * A name for the variable that represents each individual element of the input array.
2901
+ * If no name is specified, the variable name defaults to this.
2902
+ */
2903
+ as?: string;
2904
+
2905
+ /**
2906
+ * A name for the variable that represents the cumulative value of the expression.
2907
+ * If no name is specified, the variable name defaults to value.
2908
+ */
2909
+ valueAs?: string;
2910
+
2911
+ /**
2912
+ * A name for the variable that represents the index of the current element in
2913
+ * the input array. If specified, this variable is available within the in expression.
2914
+ */
2915
+ arrayIndexAs?: string;
2892
2916
  };
2893
2917
  }
2894
2918
 
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "email": "compass@mongodb.com"
14
14
  },
15
15
  "homepage": "https://github.com/mongodb-js/devtools-shared",
16
- "version": "0.5.2",
16
+ "version": "0.6.0",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "https://github.com/mongodb-js/devtools-shared.git"
@@ -95,5 +95,5 @@
95
95
  "bson": "^4.6.3 || ^5 || ^6.10.3 || ^7.0.0",
96
96
  "mongodb": "^7.2.0"
97
97
  },
98
- "gitHead": "ff06112af9878b9d56550ac5e34280a12f4a555c"
98
+ "gitHead": "5dc1de332aca309fc9cd89af56146b3f2400abf8"
99
99
  }