{"action":"created","issue":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/930","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/930/labels{/name}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/930/comments","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/930/events","html_url":"https://github.com/MongoEngine/mongoengine/issues/930","id":66452600,"number":930,"title":"Empty ListFields of EmbeddedDocuments with a unique field may only exist once (MongoEngine 0.9.0)","user":{"login":"eli-b","id":834999,"avatar_url":"https://avatars.githubusercontent.com/u/834999?v=3","gravatar_id":"","url":"https://api.github.com/users/eli-b","html_url":"https://github.com/eli-b","followers_url":"https://api.github.com/users/eli-b/followers","following_url":"https://api.github.com/users/eli-b/following{/other_user}","gists_url":"https://api.github.com/users/eli-b/gists{/gist_id}","starred_url":"https://api.github.com/users/eli-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eli-b/subscriptions","organizations_url":"https://api.github.com/users/eli-b/orgs","repos_url":"https://api.github.com/users/eli-b/repos","events_url":"https://api.github.com/users/eli-b/events{/privacy}","received_events_url":"https://api.github.com/users/eli-b/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MongoEngine/mongoengine/labels/Discussion","name":"Discussion","color":"d4c5f9"},{"url":"https://api.github.com/repos/MongoEngine/mongoengine/labels/Documentation","name":"Documentation","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"seglberg","id":799727,"avatar_url":"https://avatars.githubusercontent.com/u/799727?v=3","gravatar_id":"","url":"https://api.github.com/users/seglberg","html_url":"https://github.com/seglberg","followers_url":"https://api.github.com/users/seglberg/followers","following_url":"https://api.github.com/users/seglberg/following{/other_user}","gists_url":"https://api.github.com/users/seglberg/gists{/gist_id}","starred_url":"https://api.github.com/users/seglberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seglberg/subscriptions","organizations_url":"https://api.github.com/users/seglberg/orgs","repos_url":"https://api.github.com/users/seglberg/repos","events_url":"https://api.github.com/users/seglberg/events{/privacy}","received_events_url":"https://api.github.com/users/seglberg/received_events","type":"User","site_admin":false},"milestone":null,"comments":18,"created_at":"2015-04-05T16:02:56Z","updated_at":"2015-04-30T01:38:35Z","closed_at":null,"body":"Trying to save an empty list of embedded documents which have a unique field on another document causes the following error to be thrown:\r\n```\r\nE11000 duplicate key error index: mydb.mycollection.mylist.myuniquefield_1 dup key: { : null }\r\n```\r\n\r\nInterestingly, having a primary_key field in an EmbeddedDocument in an empty ListField doesn't cause an error.\r\n\r\nThe workaround we found is to define the field on the EmbeddedDocument as unique and sparse. which is funny, since the sparse option is the reason I upgraded to mongoengine 0.9.0 in the first place..."},"comment":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/comments/97629568","html_url":"https://github.com/MongoEngine/mongoengine/issues/930#issuecomment-97629568","issue_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/930","id":97629568,"user":{"login":"eli-b","id":834999,"avatar_url":"https://avatars.githubusercontent.com/u/834999?v=3","gravatar_id":"","url":"https://api.github.com/users/eli-b","html_url":"https://github.com/eli-b","followers_url":"https://api.github.com/users/eli-b/followers","following_url":"https://api.github.com/users/eli-b/following{/other_user}","gists_url":"https://api.github.com/users/eli-b/gists{/gist_id}","starred_url":"https://api.github.com/users/eli-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eli-b/subscriptions","organizations_url":"https://api.github.com/users/eli-b/orgs","repos_url":"https://api.github.com/users/eli-b/repos","events_url":"https://api.github.com/users/eli-b/events{/privacy}","received_events_url":"https://api.github.com/users/eli-b/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T01:38:35Z","updated_at":"2015-04-30T01:38:35Z","body":"The cleaned up commits will only be ready on Sunday, sorry.\n\nOn Wed, Apr 29, 2015 at 9:01 PM, Matthieu Rigal <notifications@github.com>\nwrote:\n\n> @seglberg <https://github.com/seglberg> we are awaiting the cleaned up\n> commits from @eli-b <https://github.com/eli-b> on the PR side. When you\n> have your documentation update out, you may close this ticket also\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/MongoEngine/mongoengine/issues/930#issuecomment-97522300>\n> .\n>\n"}}