Add support for group by DBRefs by mstrotta · Pull Request #636 · mongomock/mongomock

@mstrotta

pcorpet

Choose a reason for hiding this comment

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

Thanks a lot for providing a PR to fix that bug. Please fix Travis and take a look at my comment.


try:
from bson import Regex
from bson import Regex, DBRef

Choose a reason for hiding this comment

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

mongomock should work even if pymongo is not installed. Please fix what should happen in that case.

if isinstance(val, _RE_TYPES):
return 50
if isinstance(val, DBRef):
return 55

Choose a reason for hiding this comment

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

Thanks for adding it here as well, please make sure that the sorting of type is working as in pymongo by adding a line in test__sort_mixed_types in test__mongomock.py

list(actual)
)

def test__aggregate_group_dbref_key(self):

Choose a reason for hiding this comment

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

Thanks for adding a unit test. Please also add an equivalent test in test__mongomock.py to ensure consistency with pymongo behavior.

@kosqx

Hi! Your CI build failed because of the #648 error.

I will push the fix soon

@kosqx

The fix is ready, tests are passing: #649

Mike Trotta and others added 2 commits

July 31, 2020 20:22

@pcorpet

@pcorpet

@codecov