Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing densify type pipeline type #12533

Conversation

FabioCingottini
Copy link

densify pipeline stage was not in the union type
for PipelineStage, this was causing ts error when
users were trying to call the aggregate method with
densify stage

Summary

After declaring a model and using its .aggregation method with a $densify stage, I received an error related to the fact that there was no method overload matching a pipeline with $densify as a stage.
Looking at the PipelineStage type, I saw that PipelineStage.Densify was missing in the union type.
So I just added it.

Examples
The following was causing an error, now it's allowed.

MyModel.aggregate([
  {
    $densify: ...
  }
])

densify pipeline stage was not in the union type
for PipelineStage, this was causing ts error when
users where trying to call aggregate method with
densify stage
@emilskovmand
Copy link

This is the same for the $fill stage

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

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

Welcome, @FabioCingottini 👋
LGTM, thanks 👍

@AbdelrahmanHafez AbdelrahmanHafez merged commit 95496c8 into Automattic:master Oct 6, 2022
@AbdelrahmanHafez AbdelrahmanHafez added this to the 6.6.6 milestone Oct 6, 2022
@AbdelrahmanHafez AbdelrahmanHafez added the typescript Types or Types-test related issue / Pull Request label Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants