{"action":"closed","number":200,"pull_request":{"url":"https://api.github.com/repos/fakemongo/fongo/pulls/200","id":66194042,"html_url":"https://github.com/fakemongo/fongo/pull/200","diff_url":"https://github.com/fakemongo/fongo/pull/200.diff","patch_url":"https://github.com/fakemongo/fongo/pull/200.patch","issue_url":"https://api.github.com/repos/fakemongo/fongo/issues/200","number":200,"state":"closed","locked":false,"title":"Exception missmatch between Fongo and MongoDB on findAndModify with unique index","user":{"login":"scho","id":57036,"avatar_url":"https://avatars.githubusercontent.com/u/57036?v=3","gravatar_id":"","url":"https://api.github.com/users/scho","html_url":"https://github.com/scho","followers_url":"https://api.github.com/users/scho/followers","following_url":"https://api.github.com/users/scho/following{/other_user}","gists_url":"https://api.github.com/users/scho/gists{/gist_id}","starred_url":"https://api.github.com/users/scho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scho/subscriptions","organizations_url":"https://api.github.com/users/scho/orgs","repos_url":"https://api.github.com/users/scho/repos","events_url":"https://api.github.com/users/scho/events{/privacy}","received_events_url":"https://api.github.com/users/scho/received_events","type":"User","site_admin":false},"body":"Given the following data structure:\r\n```json\r\n{\r\n  \"_id\": \"someId\",\r\n  \"value\": \"someValue\"\r\n}\r\n```\r\nThere is a unique index on `value`.\r\n\r\nIf I try to update a document using `findAndModify` and set `value` to an already existing `value` in the collection, the following happens:\r\n\r\nFongo throws a `com.mongodb.DuplicateKeyException`.\r\nMongoDB throws a `com.mongodb.MongoCommandException`.\r\n\r\nMongoDB driver version: `3.2.0`\r\nMongoDB version: `3.2.4`\r\nFongo version: `2.0.6`\r\n\r\nIs there a way I can provide a PR? If so, please point me into a direction and I'll try my best :)","created_at":"2016-04-12T17:11:36Z","updated_at":"2016-04-16T15:00:03Z","closed_at":"2016-04-16T15:00:03Z","merged_at":"2016-04-16T15:00:03Z","merge_commit_sha":"2ae4fb6fb2966e8493b232b5a2854d05bfbe4d54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fakemongo/fongo/pulls/200/commits","review_comments_url":"https://api.github.com/repos/fakemongo/fongo/pulls/200/comments","review_comment_url":"https://api.github.com/repos/fakemongo/fongo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fakemongo/fongo/issues/200/comments","statuses_url":"https://api.github.com/repos/fakemongo/fongo/statuses/d24b2b40a6b88317669abe4914befc4633f635e4","head":{"label":"scho:issue-200","ref":"issue-200","sha":"d24b2b40a6b88317669abe4914befc4633f635e4","user":{"login":"scho","id":57036,"avatar_url":"https://avatars.githubusercontent.com/u/57036?v=3","gravatar_id":"","url":"https://api.github.com/users/scho","html_url":"https://github.com/scho","followers_url":"https://api.github.com/users/scho/followers","following_url":"https://api.github.com/users/scho/following{/other_user}","gists_url":"https://api.github.com/users/scho/gists{/gist_id}","starred_url":"https://api.github.com/users/scho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scho/subscriptions","organizations_url":"https://api.github.com/users/scho/orgs","repos_url":"https://api.github.com/users/scho/repos","events_url":"https://api.github.com/users/scho/events{/privacy}","received_events_url":"https://api.github.com/users/scho/received_events","type":"User","site_admin":false},"repo":{"id":55988529,"name":"fongo","full_name":"scho/fongo","owner":{"login":"scho","id":57036,"avatar_url":"https://avatars.githubusercontent.com/u/57036?v=3","gravatar_id":"","url":"https://api.github.com/users/scho","html_url":"https://github.com/scho","followers_url":"https://api.github.com/users/scho/followers","following_url":"https://api.github.com/users/scho/following{/other_user}","gists_url":"https://api.github.com/users/scho/gists{/gist_id}","starred_url":"https://api.github.com/users/scho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scho/subscriptions","organizations_url":"https://api.github.com/users/scho/orgs","repos_url":"https://api.github.com/users/scho/repos","events_url":"https://api.github.com/users/scho/events{/privacy}","received_events_url":"https://api.github.com/users/scho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scho/fongo","description":"faked out in-memory mongo for java","fork":true,"url":"https://api.github.com/repos/scho/fongo","forks_url":"https://api.github.com/repos/scho/fongo/forks","keys_url":"https://api.github.com/repos/scho/fongo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scho/fongo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scho/fongo/teams","hooks_url":"https://api.github.com/repos/scho/fongo/hooks","issue_events_url":"https://api.github.com/repos/scho/fongo/issues/events{/number}","events_url":"https://api.github.com/repos/scho/fongo/events","assignees_url":"https://api.github.com/repos/scho/fongo/assignees{/user}","branches_url":"https://api.github.com/repos/scho/fongo/branches{/branch}","tags_url":"https://api.github.com/repos/scho/fongo/tags","blobs_url":"https://api.github.com/repos/scho/fongo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scho/fongo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scho/fongo/git/refs{/sha}","trees_url":"https://api.github.com/repos/scho/fongo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scho/fongo/statuses/{sha}","languages_url":"https://api.github.com/repos/scho/fongo/languages","stargazers_url":"https://api.github.com/repos/scho/fongo/stargazers","contributors_url":"https://api.github.com/repos/scho/fongo/contributors","subscribers_url":"https://api.github.com/repos/scho/fongo/subscribers","subscription_url":"https://api.github.com/repos/scho/fongo/subscription","commits_url":"https://api.github.com/repos/scho/fongo/commits{/sha}","git_commits_url":"https://api.github.com/repos/scho/fongo/git/commits{/sha}","comments_url":"https://api.github.com/repos/scho/fongo/comments{/number}","issue_comment_url":"https://api.github.com/repos/scho/fongo/issues/comments{/number}","contents_url":"https://api.github.com/repos/scho/fongo/contents/{+path}","compare_url":"https://api.github.com/repos/scho/fongo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scho/fongo/merges","archive_url":"https://api.github.com/repos/scho/fongo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scho/fongo/downloads","issues_url":"https://api.github.com/repos/scho/fongo/issues{/number}","pulls_url":"https://api.github.com/repos/scho/fongo/pulls{/number}","milestones_url":"https://api.github.com/repos/scho/fongo/milestones{/number}","notifications_url":"https://api.github.com/repos/scho/fongo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scho/fongo/labels{/name}","releases_url":"https://api.github.com/repos/scho/fongo/releases{/id}","deployments_url":"https://api.github.com/repos/scho/fongo/deployments","created_at":"2016-04-11T16:24:23Z","updated_at":"2016-04-11T16:24:24Z","pushed_at":"2016-04-12T17:21:48Z","git_url":"git://github.com/scho/fongo.git","ssh_url":"git@github.com:scho/fongo.git","clone_url":"https://github.com/scho/fongo.git","svn_url":"https://github.com/scho/fongo","homepage":"","size":3218,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fakemongo:v3","ref":"v3","sha":"ce336eb46af046788dc659e8cf2f7c056d79c8b8","user":{"login":"fakemongo","id":5858622,"avatar_url":"https://avatars.githubusercontent.com/u/5858622?v=3","gravatar_id":"","url":"https://api.github.com/users/fakemongo","html_url":"https://github.com/fakemongo","followers_url":"https://api.github.com/users/fakemongo/followers","following_url":"https://api.github.com/users/fakemongo/following{/other_user}","gists_url":"https://api.github.com/users/fakemongo/gists{/gist_id}","starred_url":"https://api.github.com/users/fakemongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fakemongo/subscriptions","organizations_url":"https://api.github.com/users/fakemongo/orgs","repos_url":"https://api.github.com/users/fakemongo/repos","events_url":"https://api.github.com/users/fakemongo/events{/privacy}","received_events_url":"https://api.github.com/users/fakemongo/received_events","type":"User","site_admin":false},"repo":{"id":14143348,"name":"fongo","full_name":"fakemongo/fongo","owner":{"login":"fakemongo","id":5858622,"avatar_url":"https://avatars.githubusercontent.com/u/5858622?v=3","gravatar_id":"","url":"https://api.github.com/users/fakemongo","html_url":"https://github.com/fakemongo","followers_url":"https://api.github.com/users/fakemongo/followers","following_url":"https://api.github.com/users/fakemongo/following{/other_user}","gists_url":"https://api.github.com/users/fakemongo/gists{/gist_id}","starred_url":"https://api.github.com/users/fakemongo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fakemongo/subscriptions","organizations_url":"https://api.github.com/users/fakemongo/orgs","repos_url":"https://api.github.com/users/fakemongo/repos","events_url":"https://api.github.com/users/fakemongo/events{/privacy}","received_events_url":"https://api.github.com/users/fakemongo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fakemongo/fongo","description":"faked out in-memory mongo for java","fork":true,"url":"https://api.github.com/repos/fakemongo/fongo","forks_url":"https://api.github.com/repos/fakemongo/fongo/forks","keys_url":"https://api.github.com/repos/fakemongo/fongo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fakemongo/fongo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fakemongo/fongo/teams","hooks_url":"https://api.github.com/repos/fakemongo/fongo/hooks","issue_events_url":"https://api.github.com/repos/fakemongo/fongo/issues/events{/number}","events_url":"https://api.github.com/repos/fakemongo/fongo/events","assignees_url":"https://api.github.com/repos/fakemongo/fongo/assignees{/user}","branches_url":"https://api.github.com/repos/fakemongo/fongo/branches{/branch}","tags_url":"https://api.github.com/repos/fakemongo/fongo/tags","blobs_url":"https://api.github.com/repos/fakemongo/fongo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fakemongo/fongo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fakemongo/fongo/git/refs{/sha}","trees_url":"https://api.github.com/repos/fakemongo/fongo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fakemongo/fongo/statuses/{sha}","languages_url":"https://api.github.com/repos/fakemongo/fongo/languages","stargazers_url":"https://api.github.com/repos/fakemongo/fongo/stargazers","contributors_url":"https://api.github.com/repos/fakemongo/fongo/contributors","subscribers_url":"https://api.github.com/repos/fakemongo/fongo/subscribers","subscription_url":"https://api.github.com/repos/fakemongo/fongo/subscription","commits_url":"https://api.github.com/repos/fakemongo/fongo/commits{/sha}","git_commits_url":"https://api.github.com/repos/fakemongo/fongo/git/commits{/sha}","comments_url":"https://api.github.com/repos/fakemongo/fongo/comments{/number}","issue_comment_url":"https://api.github.com/repos/fakemongo/fongo/issues/comments{/number}","contents_url":"https://api.github.com/repos/fakemongo/fongo/contents/{+path}","compare_url":"https://api.github.com/repos/fakemongo/fongo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fakemongo/fongo/merges","archive_url":"https://api.github.com/repos/fakemongo/fongo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fakemongo/fongo/downloads","issues_url":"https://api.github.com/repos/fakemongo/fongo/issues{/number}","pulls_url":"https://api.github.com/repos/fakemongo/fongo/pulls{/number}","milestones_url":"https://api.github.com/repos/fakemongo/fongo/milestones{/number}","notifications_url":"https://api.github.com/repos/fakemongo/fongo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fakemongo/fongo/labels{/name}","releases_url":"https://api.github.com/repos/fakemongo/fongo/releases{/id}","deployments_url":"https://api.github.com/repos/fakemongo/fongo/deployments","created_at":"2013-11-05T14:22:05Z","updated_at":"2016-04-06T19:11:08Z","pushed_at":"2016-04-16T15:00:03Z","git_url":"git://github.com/fakemongo/fongo.git","ssh_url":"git@github.com:fakemongo/fongo.git","clone_url":"https://github.com/fakemongo/fongo.git","svn_url":"https://github.com/fakemongo/fongo","homepage":"","size":3818,"stargazers_count":224,"watchers_count":224,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"open_issues_count":13,"forks":78,"open_issues":13,"watchers":224,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fakemongo/fongo/pulls/200"},"html":{"href":"https://github.com/fakemongo/fongo/pull/200"},"issue":{"href":"https://api.github.com/repos/fakemongo/fongo/issues/200"},"comments":{"href":"https://api.github.com/repos/fakemongo/fongo/issues/200/comments"},"review_comments":{"href":"https://api.github.com/repos/fakemongo/fongo/pulls/200/comments"},"review_comment":{"href":"https://api.github.com/repos/fakemongo/fongo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fakemongo/fongo/pulls/200/commits"},"statuses":{"href":"https://api.github.com/repos/fakemongo/fongo/statuses/d24b2b40a6b88317669abe4914befc4633f635e4"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"twillouer","id":2970220,"avatar_url":"https://avatars.githubusercontent.com/u/2970220?v=3","gravatar_id":"","url":"https://api.github.com/users/twillouer","html_url":"https://github.com/twillouer","followers_url":"https://api.github.com/users/twillouer/followers","following_url":"https://api.github.com/users/twillouer/following{/other_user}","gists_url":"https://api.github.com/users/twillouer/gists{/gist_id}","starred_url":"https://api.github.com/users/twillouer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twillouer/subscriptions","organizations_url":"https://api.github.com/users/twillouer/orgs","repos_url":"https://api.github.com/users/twillouer/repos","events_url":"https://api.github.com/users/twillouer/events{/privacy}","received_events_url":"https://api.github.com/users/twillouer/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":1,"additions":27,"deletions":1,"changed_files":3}}