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

Fix for #846 #847

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Fix for #846 #847

wants to merge 1 commit into from

Conversation

sumezulike
Copy link

@sumezulike sumezulike commented Jun 1, 2023

This fixes the bug with the $each modifier in $addToSet. (Closes #846)

Just replacing the list comprehension with a loop seems to be the most straightforward way to solve this issue.

Other common ways to get unique elements from a list are using a set or dict.fromkeys, but those methods don't work for unhashable types, like lists.

… one to eliminate duplicates. Extended existing testcase.
@sumezulike sumezulike changed the title Fix for mongomock#846 Fix for #846 Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$each modifier is not handled correctly in $addToSet command
1 participant