{"action":"created","comment":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments/34069858","id":34069858,"diff_hunk":"@@ -268,10 +268,20 @@ public function setOwner($document, array $mapping)\n \n     /**\n      * INTERNAL:\n-     * Tells this collection to take a snapshot of its current state.\n+     * Tells this collection to take a snapshot of its current state reindexing\n+     * itself numerically if using save strategy that is enforcing BSON array.\n+     * Reindexing is safe as snapshot is taken only after synchronizing collection\n+     * with database or clearing it.\n      */\n     public function takeSnapshot()\n     {\n+        if (in_array($this->mapping['strategy'], array('atomicSetArray', 'setArray', 'pushAll', 'addToSet'))) {","path":"lib/Doctrine/ODM/MongoDB/PersistentCollection.php","position":12,"original_position":12,"commit_id":"67a9944dea52686bffebd33c85a0bf3f1c280939","original_commit_id":"67a9944dea52686bffebd33c85a0bf3f1c280939","user":{"login":"malarzm","id":4947711,"avatar_url":"https://avatars.githubusercontent.com/u/4947711?v=3","gravatar_id":"","url":"https://api.github.com/users/malarzm","html_url":"https://github.com/malarzm","followers_url":"https://api.github.com/users/malarzm/followers","following_url":"https://api.github.com/users/malarzm/following{/other_user}","gists_url":"https://api.github.com/users/malarzm/gists{/gist_id}","starred_url":"https://api.github.com/users/malarzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malarzm/subscriptions","organizations_url":"https://api.github.com/users/malarzm/orgs","repos_url":"https://api.github.com/users/malarzm/repos","events_url":"https://api.github.com/users/malarzm/events{/privacy}","received_events_url":"https://api.github.com/users/malarzm/received_events","type":"User","site_admin":false},"body":"TODO: utilize CollectionHelper once #1155 is merged","created_at":"2015-07-07T17:59:48Z","updated_at":"2015-07-07T17:59:48Z","html_url":"https://github.com/doctrine/mongodb-odm/pull/1130#discussion_r34069858","pull_request_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130","_links":{"self":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments/34069858"},"html":{"href":"https://github.com/doctrine/mongodb-odm/pull/1130#discussion_r34069858"},"pull_request":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130"}}},"pull_request":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130","id":37312785,"html_url":"https://github.com/doctrine/mongodb-odm/pull/1130","diff_url":"https://github.com/doctrine/mongodb-odm/pull/1130.diff","patch_url":"https://github.com/doctrine/mongodb-odm/pull/1130.patch","issue_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1130","number":1130,"state":"open","locked":false,"title":"Reindex numerically PersistentCollection after save","user":{"login":"malarzm","id":4947711,"avatar_url":"https://avatars.githubusercontent.com/u/4947711?v=3","gravatar_id":"","url":"https://api.github.com/users/malarzm","html_url":"https://github.com/malarzm","followers_url":"https://api.github.com/users/malarzm/followers","following_url":"https://api.github.com/users/malarzm/following{/other_user}","gists_url":"https://api.github.com/users/malarzm/gists{/gist_id}","starred_url":"https://api.github.com/users/malarzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malarzm/subscriptions","organizations_url":"https://api.github.com/users/malarzm/orgs","repos_url":"https://api.github.com/users/malarzm/repos","events_url":"https://api.github.com/users/malarzm/events{/privacy}","received_events_url":"https://api.github.com/users/malarzm/received_events","type":"User","site_admin":false},"body":"Fixes #944 and brings `PersistentCollection` in line with what is in database although it will be a BC break if somebody relied on using old indexes.","created_at":"2015-06-09T23:55:22Z","updated_at":"2015-07-07T17:59:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eff04a480f01943ef68c46109b4f0deee0c51343","assignee":null,"milestone":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/milestones/1","html_url":"https://github.com/doctrine/mongodb-odm/milestones/1.0.0","labels_url":"https://api.github.com/repos/doctrine/mongodb-odm/milestones/1/labels","id":543770,"number":1,"title":"1.0.0","description":"","creator":{"login":"jmikola","id":244663,"avatar_url":"https://avatars.githubusercontent.com/u/244663?v=3","gravatar_id":"","url":"https://api.github.com/users/jmikola","html_url":"https://github.com/jmikola","followers_url":"https://api.github.com/users/jmikola/followers","following_url":"https://api.github.com/users/jmikola/following{/other_user}","gists_url":"https://api.github.com/users/jmikola/gists{/gist_id}","starred_url":"https://api.github.com/users/jmikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmikola/subscriptions","organizations_url":"https://api.github.com/users/jmikola/orgs","repos_url":"https://api.github.com/users/jmikola/repos","events_url":"https://api.github.com/users/jmikola/events{/privacy}","received_events_url":"https://api.github.com/users/jmikola/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":40,"state":"open","created_at":"2014-01-22T04:49:23Z","updated_at":"2015-07-03T10:09:22Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130/commits","review_comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130/comments","review_comment_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1130/comments","statuses_url":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/67a9944dea52686bffebd33c85a0bf3f1c280939","head":{"label":"malarzm:gh944","ref":"gh944","sha":"67a9944dea52686bffebd33c85a0bf3f1c280939","user":{"login":"malarzm","id":4947711,"avatar_url":"https://avatars.githubusercontent.com/u/4947711?v=3","gravatar_id":"","url":"https://api.github.com/users/malarzm","html_url":"https://github.com/malarzm","followers_url":"https://api.github.com/users/malarzm/followers","following_url":"https://api.github.com/users/malarzm/following{/other_user}","gists_url":"https://api.github.com/users/malarzm/gists{/gist_id}","starred_url":"https://api.github.com/users/malarzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malarzm/subscriptions","organizations_url":"https://api.github.com/users/malarzm/orgs","repos_url":"https://api.github.com/users/malarzm/repos","events_url":"https://api.github.com/users/malarzm/events{/privacy}","received_events_url":"https://api.github.com/users/malarzm/received_events","type":"User","site_admin":false},"repo":{"id":17143940,"name":"mongodb-odm","full_name":"malarzm/mongodb-odm","owner":{"login":"malarzm","id":4947711,"avatar_url":"https://avatars.githubusercontent.com/u/4947711?v=3","gravatar_id":"","url":"https://api.github.com/users/malarzm","html_url":"https://github.com/malarzm","followers_url":"https://api.github.com/users/malarzm/followers","following_url":"https://api.github.com/users/malarzm/following{/other_user}","gists_url":"https://api.github.com/users/malarzm/gists{/gist_id}","starred_url":"https://api.github.com/users/malarzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malarzm/subscriptions","organizations_url":"https://api.github.com/users/malarzm/orgs","repos_url":"https://api.github.com/users/malarzm/repos","events_url":"https://api.github.com/users/malarzm/events{/privacy}","received_events_url":"https://api.github.com/users/malarzm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/malarzm/mongodb-odm","description":"Doctrine MongoDB Object Document Mapper (ODM)","fork":true,"url":"https://api.github.com/repos/malarzm/mongodb-odm","forks_url":"https://api.github.com/repos/malarzm/mongodb-odm/forks","keys_url":"https://api.github.com/repos/malarzm/mongodb-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/malarzm/mongodb-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/malarzm/mongodb-odm/teams","hooks_url":"https://api.github.com/repos/malarzm/mongodb-odm/hooks","issue_events_url":"https://api.github.com/repos/malarzm/mongodb-odm/issues/events{/number}","events_url":"https://api.github.com/repos/malarzm/mongodb-odm/events","assignees_url":"https://api.github.com/repos/malarzm/mongodb-odm/assignees{/user}","branches_url":"https://api.github.com/repos/malarzm/mongodb-odm/branches{/branch}","tags_url":"https://api.github.com/repos/malarzm/mongodb-odm/tags","blobs_url":"https://api.github.com/repos/malarzm/mongodb-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/malarzm/mongodb-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/malarzm/mongodb-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/malarzm/mongodb-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/malarzm/mongodb-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/malarzm/mongodb-odm/languages","stargazers_url":"https://api.github.com/repos/malarzm/mongodb-odm/stargazers","contributors_url":"https://api.github.com/repos/malarzm/mongodb-odm/contributors","subscribers_url":"https://api.github.com/repos/malarzm/mongodb-odm/subscribers","subscription_url":"https://api.github.com/repos/malarzm/mongodb-odm/subscription","commits_url":"https://api.github.com/repos/malarzm/mongodb-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/malarzm/mongodb-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/malarzm/mongodb-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/malarzm/mongodb-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/malarzm/mongodb-odm/contents/{+path}","compare_url":"https://api.github.com/repos/malarzm/mongodb-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/malarzm/mongodb-odm/merges","archive_url":"https://api.github.com/repos/malarzm/mongodb-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/malarzm/mongodb-odm/downloads","issues_url":"https://api.github.com/repos/malarzm/mongodb-odm/issues{/number}","pulls_url":"https://api.github.com/repos/malarzm/mongodb-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/malarzm/mongodb-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/malarzm/mongodb-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/malarzm/mongodb-odm/labels{/name}","releases_url":"https://api.github.com/repos/malarzm/mongodb-odm/releases{/id}","created_at":"2014-02-24T17:15:20Z","updated_at":"2015-04-23T15:07:38Z","pushed_at":"2015-07-03T16:09:26Z","git_url":"git://github.com/malarzm/mongodb-odm.git","ssh_url":"git@github.com:malarzm/mongodb-odm.git","clone_url":"https://github.com/malarzm/mongodb-odm.git","svn_url":"https://github.com/malarzm/mongodb-odm","homepage":"http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/","size":7344,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"doctrine:master","ref":"master","sha":"d305acad9307a9f7419ec8a6f904de2fae38f770","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"repo":{"id":677781,"name":"mongodb-odm","full_name":"doctrine/mongodb-odm","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doctrine/mongodb-odm","description":"Doctrine MongoDB Object Document Mapper (ODM)","fork":false,"url":"https://api.github.com/repos/doctrine/mongodb-odm","forks_url":"https://api.github.com/repos/doctrine/mongodb-odm/forks","keys_url":"https://api.github.com/repos/doctrine/mongodb-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/mongodb-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/mongodb-odm/teams","hooks_url":"https://api.github.com/repos/doctrine/mongodb-odm/hooks","issue_events_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/mongodb-odm/events","assignees_url":"https://api.github.com/repos/doctrine/mongodb-odm/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/mongodb-odm/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/mongodb-odm/tags","blobs_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/mongodb-odm/languages","stargazers_url":"https://api.github.com/repos/doctrine/mongodb-odm/stargazers","contributors_url":"https://api.github.com/repos/doctrine/mongodb-odm/contributors","subscribers_url":"https://api.github.com/repos/doctrine/mongodb-odm/subscribers","subscription_url":"https://api.github.com/repos/doctrine/mongodb-odm/subscription","commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/mongodb-odm/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/mongodb-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/mongodb-odm/merges","archive_url":"https://api.github.com/repos/doctrine/mongodb-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/mongodb-odm/downloads","issues_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/mongodb-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/mongodb-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/mongodb-odm/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/mongodb-odm/releases{/id}","created_at":"2010-05-20T20:20:00Z","updated_at":"2015-07-05T15:04:39Z","pushed_at":"2015-07-07T11:13:33Z","git_url":"git://github.com/doctrine/mongodb-odm.git","ssh_url":"git@github.com:doctrine/mongodb-odm.git","clone_url":"https://github.com/doctrine/mongodb-odm.git","svn_url":"https://github.com/doctrine/mongodb-odm","homepage":"http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/","size":14220,"stargazers_count":551,"watchers_count":551,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":319,"mirror_url":null,"open_issues_count":167,"forks":319,"open_issues":167,"watchers":551,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130"},"html":{"href":"https://github.com/doctrine/mongodb-odm/pull/1130"},"issue":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1130"},"comments":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1130/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1130/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/67a9944dea52686bffebd33c85a0bf3f1c280939"}}}}