{"action":"opened","issue":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1233","repository_url":"https://api.github.com/repos/MongoEngine/mongoengine","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1233/labels{/name}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1233/comments","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1233/events","html_url":"https://github.com/MongoEngine/mongoengine/issues/1233","id":132997442,"number":1233,"title":"OperationError: Could not save document (have conflicting mods in update), when updating DictField","user":{"login":"alexsv","id":383632,"avatar_url":"https://avatars.githubusercontent.com/u/383632?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsv","html_url":"https://github.com/alexsv","followers_url":"https://api.github.com/users/alexsv/followers","following_url":"https://api.github.com/users/alexsv/following{/other_user}","gists_url":"https://api.github.com/users/alexsv/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsv/subscriptions","organizations_url":"https://api.github.com/users/alexsv/orgs","repos_url":"https://api.github.com/users/alexsv/repos","events_url":"https://api.github.com/users/alexsv/events{/privacy}","received_events_url":"https://api.github.com/users/alexsv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-11T15:08:22Z","updated_at":"2016-02-11T15:08:22Z","closed_at":null,"body":"```python\r\nimport mongoengine   #  version: 0.10.0\r\nfrom random import choice\r\nfrom mongoengine import Document, DictField\r\n\r\nmongoengine.connect()\r\n\r\nrandomdata = lambda: {k:choice([None, None, 1, 2, 3, 4, 5, 6]) \r\n   for k in ['aaaa','bbbb','cccc','dddd','eeee','dddd']}\r\n\r\nclass SampleDoc(Document):\r\n  data = DictField()\r\n  def set_data(self, values):\r\n    for k,v in values.iteritems():\r\n      if v is None:\r\n        self.data.pop(k, None)\r\n      else:\r\n        self.data[k] = v\r\n\r\ndoc = SampleDoc()\r\nfor i in range(10):\r\n  doc.set_data(random_data())\r\n  doc.save()\r\n```\r\nAnd in interactive console I get:\r\n```\r\n<SampleDoc: SampleDoc object>\r\n<SampleDoc: SampleDoc object>\r\n<SampleDoc: SampleDoc object>\r\n<SampleDoc: SampleDoc object>\r\n<SampleDoc: SampleDoc object>\r\n<SampleDoc: SampleDoc object>\r\nTraceback (most recent call last):\r\n  File \"<console>\", line 3, in <module>\r\n  File \".../mongoengine-0.10.0-py2.7.egg/mongoengine/document.py\", line 391, in save\r\n    raise OperationError(message % unicode(err))\r\nOperationError: Could not save document (have conflicting mods in update)\r\n```\r\nif I check *_changed_fields*:\r\n```\r\n>>> d._changed_fields\r\n['data.cccc', 'data']\r\n```"}}