skip to Main Content

Mongodb – Use keys as variables in python

I'm trying to remove the keys from a mongoengine Document in python: document.update(unset__name=True) document.update(unset__surname=True) document.update(unset__dob=True) ... but instead of the above I would like to loop through them and use a variable, something like: document.update(unset__<key>=True) Is this possible?

VIEW QUESTION
Back To Top
Search