Skip to content

Commit 2f66b76

Browse files
committed
Wording
1 parent acb5520 commit 2f66b76

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

generator/README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ The `generator/config/*.yaml` files contains the list of operators and stages th
1919

2020
### Arguments
2121

22-
| Field | Type | Description |
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-
| `type` | list of `string` | The list of accepted types |
25-
| `description` | `string` | The description of the argument from MongoDB's documentation. |
26-
| `optional` | `boolean` | Whether the argument is optional or not. |
27-
| `valueMin` | `number` | The minimum value for a numeric argument. |
28-
| `valueMax` | `number` | The maximum value for a numeric argument. |
29-
| `variadic` | `string` | If sent, the argument is variadic. Defines the format `array` for a list or `object` for a map |
30-
| `variadicMin` | `integer` | The minimum number of arguments for a variadic parameter. |
31-
| `default` | `scalar` or `array` | The default value for the argument. |
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. |
22+
| Field | Type | Description |
23+
|---------------|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
24+
| `name` | `string` | The name of the argument. If it starts with `$`, the dollar is trimmed from the class property name |
25+
| `type` | list of `string` | The list of accepted types |
26+
| `description` | `string` | The description of the argument from MongoDB's documentation |
27+
| `optional` | `boolean` | Whether the argument is optional or not |
28+
| `valueMin` | `number` | The minimum value for a numeric argument |
29+
| `valueMax` | `number` | The maximum value for a numeric argument |
30+
| `variadic` | `string` | If sent, the argument is variadic. Defines the format `array` for a list or `object` for a map |
31+
| `variadicMin` | `integer` | The minimum number of arguments for a variadic parameter |
32+
| `default` | `scalar` or `array` | The default value for the argument |
33+
| `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 |
3334

3435
### Test pipelines
3536

src/Builder/Encoder/OperatorEncoder.php

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ private function encodeAsObject(OperatorInterface $value): stdClass
7474
continue;
7575
}
7676

77+
// The name is null for arguments with "mergeObject: true" in the YAML file,
78+
// the value properties are merged into the parent object.
7779
if ($name === null) {
7880
$val = $this->recursiveEncode($val);
7981
foreach ($val as $k => $v) {

0 commit comments

Comments
 (0)