Skip to content

Commit c027132

Browse files
committed
type tweaks
1 parent cc2c832 commit c027132

File tree

8 files changed

+38
-7
lines changed

8 files changed

+38
-7
lines changed

generator/config/accumulator/lastN.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: |
1212
arguments:
1313
- name: input
1414
type:
15-
- resolvesToArray
15+
- expression
1616
description: |
1717
An expression that resolves to the array from which to return n elements.
1818
- name: n

generator/config/expression/avg.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ tests:
1818
pipeline:
1919
- $project:
2020
quizAvg:
21-
$avg:
22-
- $quizzes
21+
$avg: $quizzes
2322
labAvg:
24-
$avg:
25-
- $labs
23+
$avg: $labs
2624
examAvg:
2725
$avg:
2826
- $final

generator/config/expression/dateAdd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ tests:
7979
purchaseDate:
8080
types:
8181
- bsonType: Date
82+
deliveryDate:
83+
types:
84+
- bsonType: Date
8285
- name: Adjust for Daylight Savings Time
8386
link: https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateAdd/#adjust-for-daylight-savings-time
8487
pipeline:

generator/config/expression/let.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: |
1010
arguments:
1111
- name: vars
1212
type:
13-
- object
13+
- expressionMap
1414
description: |
1515
Assignment block for the variables accessible in the in expression. To assign a variable, specify a string for the variable name and assign a valid expression for the value.
1616
The variable assignments have no meaning outside the in expression, not even within the vars block itself.

generator/config/expression/reduce.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ arguments:
2222
- name: in
2323
type:
2424
- expression
25+
- expressionMap
26+
syntheticVariables:
27+
- name: this
28+
description: |
29+
The variable that represents the cumulative value of the expression.
30+
- name: value
31+
description: |
32+
The variable that refers to the element being processed.
2533
description: |
2634
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.
2735
During evaluation of the in expression, two variables will be available:

generator/config/schema.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@
117117
"pipeline",
118118
"window",
119119
"expression",
120+
"expressionMap",
120121
"geometry",
121122
"fieldPath",
123+
"unprefixedFieldPath",
122124
"timeUnit",
123125
"sortSpec",
124126
"any",
@@ -228,6 +230,25 @@
228230
"$comment": "Skip the name in object encoding and merge the properties of the value into the operator",
229231
"type": "boolean",
230232
"default": false
233+
},
234+
"syntheticVariables": {
235+
"$comment": "A list of variables that are automatically made available during evaluation",
236+
"type": "array",
237+
"items": {
238+
"type": "object",
239+
"properties": {
240+
"name": {
241+
"type": "string",
242+
"pattern": "^[$]?[a-zA-Z0-9]*$"
243+
},
244+
"description": {
245+
"type": "string"
246+
}
247+
},
248+
"required": [
249+
"name"
250+
]
251+
}
231252
}
232253
},
233254
"required": [

generator/config/stage/group.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ arguments:
1010
- name: _id
1111
type:
1212
- expression
13+
- expressionMap
1314
description: |
1415
The _id expression specifies the group key. If you specify an _id value of null, or any other constant value, the $group stage returns a single document that aggregates values across all of the input documents.
1516
- name: field

generator/config/stage/unset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: |
1010
arguments:
1111
- name: field
1212
type:
13-
- fieldPath
13+
- unprefixedFieldPath
1414
variadic: array
1515
tests:
1616
- name: Remove a Single Field

0 commit comments

Comments
 (0)