Skip to content

Tweak types, e.g. for variables added by reduce#14

Merged
addaleax merged 5 commits intomongodb:mainfrom
mongodb-js:type-tweaks-feb26
Feb 26, 2026
Merged

Tweak types, e.g. for variables added by reduce#14
addaleax merged 5 commits intomongodb:mainfrom
mongodb-js:type-tweaks-feb26

Conversation

@addaleax
Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings February 26, 2026 15:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 unprefixedFieldPath as a new argument type to distinguish field paths without the $ prefix
  • Introduced syntheticVariables schema property to document implicitly available variables in expressions
  • Updated $unset stage to use the more semantically correct unprefixedFieldPath type instead of fieldPath

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>
Copilot AI review requested due to automatic review settings February 26, 2026 15:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@addaleax addaleax enabled auto-merge (squash) February 26, 2026 15:31
@alcaeus alcaeus self-requested a review February 26, 2026 15:55
@addaleax addaleax merged commit 10e3ca7 into mongodb:main Feb 26, 2026
3 checks passed
- name: in
type:
- expression
syntheticVariables:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have to check other stages that set such variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants