Skip to content

Conversation

@decklord
Copy link

Filtering field for None value on Embedded Document was casing Query to crash.

Something like:

MyModel.objects.filter(myembeddedfield = None)

Review on Reviewable

Choose a reason for hiding this comment

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

can't these two if statements be merged?

… parent.

We had the following changes to an object:

obj.something
obj.data.rut
obj.data._rut
obj.data._dv

Then a big change over the obj.data field was made, thus leaving changes like this:

obj.something
obj.data

But instead we where getting:

obj.something
obj.data
obj.data._rut

Then the mongodb operation raised an error of the incompatible $set operation trying to change data._rut and data at the same time.

Mongoengine had a bug because it was deleting elements on the list while iterating it.
This fixes the issue copying the list, so we iterate over the copy while we remove elements on the original.
@wojcikstefan
Copy link
Member

Hi @decklord, are you still interested in this issue? If so, please see #1422.

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.

3 participants