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 operators support for $addFields #2850

Merged
merged 29 commits into from Jun 23, 2023

Conversation

noisersup
Copy link
Member

@noisersup noisersup commented Jun 16, 2023

Description

Closes #2679.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@noisersup noisersup self-assigned this Jun 16, 2023
@noisersup noisersup added code/chore Code maintenance improvements area/aggregations Issues about aggregation pipelines labels Jun 16, 2023
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #2850 (f042aa6) into main (ced4756) will increase coverage by 0.10%.
The diff coverage is 84.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2850      +/-   ##
==========================================
+ Coverage   63.37%   63.48%   +0.10%     
==========================================
  Files         451      451              
  Lines       23465    23511      +46     
==========================================
+ Hits        14872    14926      +54     
+ Misses       7628     7619       -9     
- Partials      965      966       +1     
Impacted Files Coverage Δ
.../common/aggregations/operators/operators_errors.go 100.00% <ø> (ø)
internal/handlers/commonerrors/error.go 80.00% <ø> (ø)
internal/handlers/commonerrors/errorcode_string.go 80.00% <ø> (ø)
...andlers/common/aggregations/operators/operators.go 71.73% <70.58%> (-1.60%) ⬇️
internal/handlers/common/add_fields_iterator.go 85.71% <80.35%> (-14.29%) ⬇️
...nal/handlers/common/aggregations/operators/type.go 79.71% <100.00%> (ø)
...ommon/aggregations/stages/projection/projection.go 87.44% <100.00%> (+2.45%) ⬆️
...al/handlers/common/aggregations/stages/validate.go 71.69% <100.00%> (+12.68%) ⬆️

... and 1 file with indirect coverage changes

Flag Coverage Δ
integration 56.68% <84.00%> (+0.12%) ⬆️
mongodb 4.15% <0.00%> (-0.01%) ⬇️
pg 56.60% <84.00%> (+0.12%) ⬆️
shard-1 40.84% <12.00%> (-0.03%) ⬇️
shard-2 41.58% <0.00%> (-0.09%) ⬇️
shard-3 45.09% <84.00%> (+0.04%) ⬆️
unit 24.34% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@mergify
Copy link
Contributor

mergify bot commented Jun 16, 2023

@noisersup this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jun 16, 2023
@noisersup noisersup added the not ready Issues that are not ready to be worked on; PRs that should skip CI label Jun 18, 2023
@mergify mergify bot removed the conflict PRs that have merge conflicts label Jun 18, 2023
@AlekSi AlekSi added this to the Next milestone Jun 20, 2023
@mergify
Copy link
Contributor

mergify bot commented Jun 20, 2023

@noisersup this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jun 20, 2023
@noisersup noisersup removed the not ready Issues that are not ready to be worked on; PRs that should skip CI label Jun 20, 2023
@mergify mergify bot removed the conflict PRs that have merge conflicts label Jun 20, 2023
@mergify
Copy link
Contributor

mergify bot commented Jun 20, 2023

@noisersup this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jun 20, 2023
@chilagrow
Copy link
Contributor

Will there be another PR? The issue mentions the support of operator for common/projection.go but I'm not seeing the change related to that 🤔

Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

At the very least, there is a merge conflict

@mergify mergify bot removed the conflict PRs that have merge conflicts label Jun 21, 2023
@noisersup noisersup changed the title Add operators support for all aggregation stages Add operators support for $addFields Jun 21, 2023
@chilagrow
Copy link
Contributor

👋 @noisersup, this PR does not address what I analysed on the issue, maybe there is a confusion 🤔 The issue was about supporting $group $project and query projection to support recursive operator. At the time of analysis, $addField and $set were not implemented so that's why only 3 of them support operators. Is there a confusion in the issue where it says Supported stages support operators in the issue please? If we want to handle $addField in this issue, that's great but could you create issues for remaining $group, $project and query projection and $set too please? Maybe you've already created them 🤔

@noisersup
Copy link
Member Author

The issue was about supporting $group $project and query projection to support recursive operator.

I believe that from the description and title it seems that we need to support operators in more stages than only in $project. As we want to cut the scope for this issue I've created another issue that covers all of remaining operators -> #2881

@noisersup noisersup requested a review from chilagrow June 22, 2023 14:39
Copy link
Member

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

Looks good to me, maybe Chi can spot something as she analyzed the original task, but to me the code looks consistent with the rest of aggregation.

Copy link
Contributor

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@chilagrow chilagrow added do not merge PRs that should not be merged and removed do not merge PRs that should not be merged labels Jun 23, 2023
@noisersup noisersup merged commit 72df2bc into FerretDB:main Jun 23, 2023
45 of 53 checks passed
@noisersup noisersup deleted the operators-in-stages-2679 branch June 23, 2023 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/aggregations Issues about aggregation pipelines code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add operators support for $addFields
4 participants