Skip to content

Instantly share code, notes, and snippets.

@atroche
Created July 22, 2011 11:31
Show Gist options
  • Save atroche/1099283 to your computer and use it in GitHub Desktop.
Save atroche/1099283 to your computer and use it in GitHub Desktop.
from mongoengine import *
connect("test")
class Thing(EmbeddedDocument):
count = IntField()
class User(Document):
thing = EmbeddedDocumentField(Thing)
user = User(thing=Thing(count=1))
user.save()
user.reload() # Getting rid of this makes it work
user.thing.count = 0
user.save()
user.reload()
assert user.thing.count is None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment