-
Notifications
You must be signed in to change notification settings - Fork 333
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
Dot support for localField #603
Dot support for localField #603
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #603 +/- ##
========================================
Coverage 94.69% 94.70%
========================================
Files 16 16
Lines 3187 3190 +3
========================================
+ Hits 3018 3021 +3
Misses 169 169
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR
mongomock/aggregate.py
Outdated
@@ -601,6 +601,29 @@ def fixed_getter(doc): | |||
return fixed_getter | |||
|
|||
|
|||
def _get_local_field_val(dct, path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at helpers.get_value_by_dot
and consider using it. Also please add tests for some corner cases covered by get_value_by_dot
not covered by your code here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to get_value_by_dot
done
self.assertIn( | ||
"Although '.' is valid in the 'localField' and 'as' parameters", | ||
str(err.exception)) | ||
self.db.a.insert_many([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an equivalent test in test__mongomock
to ensure that the feature is behaving the same as in pymongo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Changed the resolver to get_value_by_dot |
related issue #595