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

Implement simple $addFields/$set aggregation pipeline stages #2783

Merged
merged 6 commits into from Jun 14, 2023

Conversation

shibasisp
Copy link
Contributor

@shibasisp shibasisp commented Jun 3, 2023

Description

Closes #2590 .
Implemented $addFields / $set aggregation pipeline.
I have added support only for literal values. Expressions will be implemented as part of #1413

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.

@shibasisp shibasisp requested a review from a team as a code owner June 3, 2023 12:41
@shibasisp shibasisp force-pushed the 2590 branch 2 times, most recently from bdb5a56 to 9bdbd52 Compare June 4, 2023 12:16
@shibasisp shibasisp force-pushed the 2590 branch 2 times, most recently from cb57a33 to fe90f00 Compare June 4, 2023 12:22
@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Merging #2783 (31f179c) into main (bdfd6b1) will decrease coverage by 0.02%.
The diff coverage is 48.80%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2783      +/-   ##
==========================================
- Coverage   64.00%   63.99%   -0.02%     
==========================================
  Files         443      446       +3     
  Lines       22658    22758     +100     
==========================================
+ Hits        14502    14563      +61     
- Misses       7208     7243      +35     
- Partials      948      952       +4     
Impacted Files Coverage Δ
...ernal/handlers/common/aggregations/stages/group.go 88.53% <0.00%> (+11.73%) ⬆️
...rnal/handlers/common/aggregations/stages/stages.go 29.03% <ø> (ø)
internal/handlers/commonerrors/error.go 80.00% <ø> (ø)
internal/handlers/commonerrors/errorcode_string.go 80.00% <ø> (ø)
internal/handlers/common/validate.go 36.84% <8.92%> (-40.09%) ⬇️
.../handlers/common/aggregations/stages/add_fields.go 73.91% <73.91%> (ø)
...nternal/handlers/common/aggregations/stages/set.go 73.91% <73.91%> (ø)
internal/handlers/common/add_fields_iterator.go 100.00% <100.00%> (ø)
Flag Coverage Δ
integration 57.10% <48.80%> (+0.01%) ⬆️
mongodb 4.98% <0.00%> (-0.03%) ⬇️
pg 57.02% <48.80%> (+0.01%) ⬆️
shard-1 41.54% <0.00%> (-2.97%) ⬇️
shard-2 44.80% <35.20%> (+2.28%) ⬆️
shard-3 42.67% <35.20%> (-0.69%) ⬇️
unit 24.92% <0.00%> (-0.12%) ⬇️

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

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.

Just great work, I have few suggestions, let me know what you think 🤗

@AlekSi AlekSi requested review from noisersup and removed request for w84thesun June 5, 2023 13:31
@AlekSi AlekSi added the code/feature Some user-visible feature is not implemented yet label Jun 5, 2023
@AlekSi AlekSi added this to the Next milestone Jun 5, 2023
@AlekSi AlekSi enabled auto-merge (squash) June 5, 2023 13:31
auto-merge was automatically disabled June 10, 2023 15:51

Head branch was pushed to by a user without write access

@chilagrow chilagrow self-requested a review June 14, 2023 00:49
chilagrow
chilagrow previously approved these changes Jun 14, 2023
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 your contribution! Great work 🚀

Just small note, we prefer merge over rebase+force push. Not having force push helps us to identify changes made during the review easier. When we merge PR into main, we squash the commits anyway 🤗

@AlekSi AlekSi enabled auto-merge (squash) June 14, 2023 08:40
chilagrow
chilagrow previously approved these changes Jun 14, 2023
@mergify
Copy link
Contributor

mergify bot commented Jun 14, 2023

@shibasisp this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jun 14, 2023
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

Looks great! @chilagrow your reapproval is needed because of merge conflict

@noisersup noisersup requested a review from chilagrow June 14, 2023 21:52
@mergify mergify bot removed the conflict PRs that have merge conflicts label Jun 14, 2023
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.

🚀

@AlekSi AlekSi merged commit d4fa206 into FerretDB:main Jun 14, 2023
41 of 51 checks passed
@shibasisp
Copy link
Contributor Author

Thank you team for reviewing my code! 🎉 And really sorry about taking so long to complete this PR 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement simple $addFields/$set aggregation pipeline stages
4 participants