Skip to content

Nx/index of array#1

Open
itsbjoern wants to merge 12 commits intosimply-do-ideas:mainfrom
guludo:nx/index-of-array
Open

Nx/index of array#1
itsbjoern wants to merge 12 commits intosimply-do-ideas:mainfrom
guludo:nx/index-of-array

Conversation

@itsbjoern
Copy link

No description provided.

guludo added 12 commits January 5, 2022 16:36
This is recommended by flake8:

    ./mongomock/aggregate.py:1434:45: E712 comparison to False should be 'if cond is not False:' or 'if cond:'
This helper will be used for aggregation operators for sets.
According to the documentation, the order of the elements resulting from
a set operation is unspecified.
That way, both $setUnion and $setEquals inherit the missing features
that are already implemented for $setIntersection, such as validation
and the correct behavior when the dictionaries have keys in different
order, for which we also add tests similar to the ones for
$setIntersection.
This patch fixes some issues when the argument of an operator is a
literal array with reference to some variable or document path (e.g.
['$foo.bar', 1]).

Note that not all places where we made the replacement check whether the
returned type is really a list, so this patch also addd a TODO comment
so we do not miss that.

This commit should to fix mongomock#700 ("$concatArrays doesn't seem to handle
when it should replace variable inside a list"). A test case is added
for such scenario. We also add a similar test case for the $map
operator.
@itsbjoern itsbjoern changed the base branch from develop to main August 7, 2025 12:03
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.

2 participants