You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: generator/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The `generator/config/*.yaml` files contains the list of operators and stages th
20
20
### Arguments
21
21
22
22
| Field | Type | Description |
23
-
|`name`|`string`| The name of the argument. It can start with `$`. |
23
+
|`name`|`string`| The name of the argument. It can start with `$` when the aggregation operator needs it, but it will be trimmed from the class property name. |
24
24
|`type`| list of `string`| The list of accepted types |
25
25
|`description`|`string`| The description of the argument from MongoDB's documentation. |
26
26
|`optional`|`boolean`| Whether the argument is optional or not. |
@@ -29,7 +29,7 @@ The `generator/config/*.yaml` files contains the list of operators and stages th
29
29
|`variadic`|`string`| If sent, the argument is variadic. Defines the format `array` for a list or `object` for a map |
30
30
|`variadicMin`|`integer`| The minimum number of arguments for a variadic parameter. |
31
31
|`default`|`scalar` or `array`| The default value for the argument. |
32
-
|`noName`|`bool`| Default `false`. If `true`, the value must be an object and the properties of the value object are merged into the parent operator. `$group` stage uses it for the fields. |
32
+
|`mergeObject`|`bool`| Default `false`. If `true`, the value must be an object and the properties of the value object are merged into the parent operator. `$group` stage uses it for the fields. |
Copy file name to clipboardExpand all lines: generator/config/stage/group.yaml
+1-1
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ arguments:
15
15
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.
if (\count(\${$argName}) < {$argument->variadicMin}) {
90
-
throw new InvalidArgumentException(\sprintf('Expected at least %d values for \${$argName}, got %d.', {$argument->variadicMin}, \count(\${$argName})));
86
+
if (\count(\${$argument->propertyName}) < {$argument->variadicMin}) {
87
+
throw new InvalidArgumentException(\sprintf('Expected at least %d values for \${$argument->propertyName}, got %d.', {$argument->variadicMin}, \count(\${$argument->propertyName})));
91
88
}
92
89
93
90
PHP);
94
91
}
95
92
96
93
if ($argument->variadic === VariadicType::Array) {
foreach(\${$argument->propertyName} as \$key => \$value) {
118
115
if (! is_string(\$key)) {
119
-
throw new InvalidArgumentException('Expected \${$argName} arguments to be a map (object), named arguments (<name>:<value>) or array unpacking ...[\'<name>\' => <value>] must be used');
116
+
throw new InvalidArgumentException('Expected \${$argument->propertyName} arguments to be a map (object), named arguments (<name>:<value>) or array unpacking ...[\'<name>\' => <value>] must be used');
0 commit comments