Tweak types, e.g. for variables added by reduce#14
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the schema definition to better support type specifications and variable documentation. It originates from the mongo-php-library project and adds semantic improvements to operator definitions, particularly for the $reduce expression operator and the $unset stage operator.
Changes:
- Added
unprefixedFieldPathas a new argument type to distinguish field paths without the$prefix - Introduced
syntheticVariablesschema property to document implicitly available variables in expressions - Updated
$unsetstage to use the more semantically correctunprefixedFieldPathtype instead offieldPath
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| schema.json | Added unprefixedFieldPath type enum value and syntheticVariables property definition to the Argument schema |
| definitions/stage/unset.yaml | Changed field argument type from fieldPath to unprefixedFieldPath for semantic correctness |
| definitions/expression/reduce.yaml | Added syntheticVariables documentation for the this and value variables available in the in expression |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: in | ||
| type: | ||
| - expression | ||
| syntheticVariables: |
There was a problem hiding this comment.
We will have to check other stages that set such variables.
Taken from mongodb/mongo-php-library@c027132 / mongodb/mongo-php-library#1659.