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

use $addFields and $project in aggregation pipelines #3174

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

brimoor
Copy link
Contributor

@brimoor brimoor commented Jun 8, 2023

Replaces all usages of $set and $unset in aggregation pipelines with $addFields and $project: {XXX: False}, respectively.

This is being done as part of an effort to broaden the compatibility of FiftyOne with older MongoDB versions and other technologies like DocumentDB.

@brimoor brimoor added enhancement Code enhancement experimental Experimental work that can be approved without review labels Jun 8, 2023
@brimoor brimoor requested a review from a team June 8, 2023 13:59
@brimoor brimoor self-assigned this Jun 8, 2023
@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (7c00686) 49.22% compared to head (bf131b1) 49.22%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3174   +/-   ##
========================================
  Coverage    49.22%   49.22%           
========================================
  Files          230      230           
  Lines        34446    34446           
  Branches       325      325           
========================================
  Hits         16957    16957           
  Misses       17489    17489           
Flag Coverage Δ
app 49.22% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@swheaton swheaton 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!

For future readers, here's the documentDB compatibility page

Side note for future, another stage we use that is unsupported by Document DB is $merge. But that one will be much harder to replace than $set and $unset I imagine.

@swheaton
Copy link
Contributor

swheaton commented Jun 8, 2023

There are also many ViewExpression functions that are incompatible such as trim and ceil. Probably not as big of a deal for it to just not work in doc db.

Also $count as an accumulator and $$CURRENT. I'm sure there's others.

@voxel51 voxel51 deleted a comment from Anddraca Jun 8, 2023
@voxel51 voxel51 deleted a comment from Anddraca Jun 8, 2023
@brimoor brimoor merged commit 8ac37aa into develop Jun 8, 2023
10 of 11 checks passed
@brimoor brimoor deleted the feature/addFields branch June 8, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Code enhancement experimental Experimental work that can be approved without review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants