Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Mongokit lazy_migration is not working when unsetting fields #240

Open
AlmogCohen opened this issue Apr 9, 2015 · 0 comments
Open

Mongokit lazy_migration is not working when unsetting fields #240

AlmogCohen opened this issue Apr 9, 2015 · 0 comments

Comments

@AlmogCohen
Copy link

I found exactly the code responsible for the bug.
in migration.py

               doc.collection.update(self.target, self.update, multi=False, safe=safe)
                # reload
                try:
                    doc.update(doc.collection.get_from_id(doc['_id']))
                except:
                    raise OperationFailure('Can not reload an unsaved document. '
                                           '%s is not found in the database' % doc['_id'])

The local document is updated with update and therefore removed fields just stay inside the document and cause the same exception for an extra field

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant