{"action":"created","comment":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments/59136266","id":59136266,"diff_hunk":"@@ -528,6 +541,33 @@ public function loadAll(array $criteria = array(), array $sort = null, $limit =\n     }\n \n     /**\n+     * @param object $document\n+     *\n+     * @return array\n+     * @throws MongoDBException\n+     */\n+    public function getShardKeyQuery($document)","path":"lib/Doctrine/ODM/MongoDB/Persisters/DocumentPersister.php","position":147,"original_position":147,"commit_id":"d464928519dc38e78c61affcd04cf0785f5657c8","original_commit_id":"d464928519dc38e78c61affcd04cf0785f5657c8","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":"This method seems to be `public` only for the sake of tests, it should be switched to `private` and tested by reflection if desired. Also PHPDoc is missing.","created_at":"2016-04-10T15:59:12Z","updated_at":"2016-04-10T15:59:12Z","html_url":"https://github.com/doctrine/mongodb-odm/pull/1385#discussion_r59136266","pull_request_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385","_links":{"self":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments/59136266"},"html":{"href":"https://github.com/doctrine/mongodb-odm/pull/1385#discussion_r59136266"},"pull_request":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385"}}},"pull_request":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385","id":62770651,"html_url":"https://github.com/doctrine/mongodb-odm/pull/1385","diff_url":"https://github.com/doctrine/mongodb-odm/pull/1385.diff","patch_url":"https://github.com/doctrine/mongodb-odm/pull/1385.patch","issue_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1385","number":1385,"state":"open","locked":false,"title":"Introduce support for sharded collections","user":{"login":"alcaeus","id":383198,"avatar_url":"https://avatars.githubusercontent.com/u/383198?v=3","gravatar_id":"","url":"https://api.github.com/users/alcaeus","html_url":"https://github.com/alcaeus","followers_url":"https://api.github.com/users/alcaeus/followers","following_url":"https://api.github.com/users/alcaeus/following{/other_user}","gists_url":"https://api.github.com/users/alcaeus/gists{/gist_id}","starred_url":"https://api.github.com/users/alcaeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcaeus/subscriptions","organizations_url":"https://api.github.com/users/alcaeus/orgs","repos_url":"https://api.github.com/users/alcaeus/repos","events_url":"https://api.github.com/users/alcaeus/events{/privacy}","received_events_url":"https://api.github.com/users/alcaeus/received_events","type":"User","site_admin":false},"body":"This PR mainly builds on top of the work done by @clslrns in #1025. Changes include running travis tests on sharded cluster and some more relaxed error handling to account for different error messages depending on the MongoDB server version used. It also adds documentation for the sharding mapping as well as the `@ShardKey` annotation.\r\n\r\nThis also supersedes the work done in #691 and #325 which have been too long-running to be useful at this stage.\r\n\r\nOne feature that will be added at a later stage is the support for denormalizing the shard key values in non-simple references; this is not required but can greatly improve query times when fetching references on a sharded collection. This will be another PR as I'm waiting for #1349 to finalize the changes made to simple/full references.\r\n\r\nTODO:\r\n- [ ] Proofread and possibly expand documentation\r\n- [x] Re-visit checks for storage strategies in shard keys; currently fields using an `increment` strategy are excluded from shard keys. While this is technically a valid solution it might make more sense to just not update these fields in the query builder instead of throwing an error in the mapping.","created_at":"2016-03-14T15:55:13Z","updated_at":"2016-04-10T15:59:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"128796888e5b387ea66571dc34976fe85dc7b983","assignee":{"login":"alcaeus","id":383198,"avatar_url":"https://avatars.githubusercontent.com/u/383198?v=3","gravatar_id":"","url":"https://api.github.com/users/alcaeus","html_url":"https://github.com/alcaeus","followers_url":"https://api.github.com/users/alcaeus/followers","following_url":"https://api.github.com/users/alcaeus/following{/other_user}","gists_url":"https://api.github.com/users/alcaeus/gists{/gist_id}","starred_url":"https://api.github.com/users/alcaeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcaeus/subscriptions","organizations_url":"https://api.github.com/users/alcaeus/orgs","repos_url":"https://api.github.com/users/alcaeus/repos","events_url":"https://api.github.com/users/alcaeus/events{/privacy}","received_events_url":"https://api.github.com/users/alcaeus/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/milestones/12","html_url":"https://github.com/doctrine/mongodb-odm/milestones/1.1","labels_url":"https://api.github.com/repos/doctrine/mongodb-odm/milestones/12/labels","id":1386633,"number":12,"title":"1.1","description":"","creator":{"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},"open_issues":4,"closed_issues":45,"state":"open","created_at":"2015-10-31T10:52:41Z","updated_at":"2016-03-28T17:52:34Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385/commits","review_comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385/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/1385/comments","statuses_url":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/d464928519dc38e78c61affcd04cf0785f5657c8","head":{"label":"alcaeus:sharding-support","ref":"sharding-support","sha":"d464928519dc38e78c61affcd04cf0785f5657c8","user":{"login":"alcaeus","id":383198,"avatar_url":"https://avatars.githubusercontent.com/u/383198?v=3","gravatar_id":"","url":"https://api.github.com/users/alcaeus","html_url":"https://github.com/alcaeus","followers_url":"https://api.github.com/users/alcaeus/followers","following_url":"https://api.github.com/users/alcaeus/following{/other_user}","gists_url":"https://api.github.com/users/alcaeus/gists{/gist_id}","starred_url":"https://api.github.com/users/alcaeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcaeus/subscriptions","organizations_url":"https://api.github.com/users/alcaeus/orgs","repos_url":"https://api.github.com/users/alcaeus/repos","events_url":"https://api.github.com/users/alcaeus/events{/privacy}","received_events_url":"https://api.github.com/users/alcaeus/received_events","type":"User","site_admin":false},"repo":{"id":48911385,"name":"mongodb-odm","full_name":"alcaeus/mongodb-odm","owner":{"login":"alcaeus","id":383198,"avatar_url":"https://avatars.githubusercontent.com/u/383198?v=3","gravatar_id":"","url":"https://api.github.com/users/alcaeus","html_url":"https://github.com/alcaeus","followers_url":"https://api.github.com/users/alcaeus/followers","following_url":"https://api.github.com/users/alcaeus/following{/other_user}","gists_url":"https://api.github.com/users/alcaeus/gists{/gist_id}","starred_url":"https://api.github.com/users/alcaeus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcaeus/subscriptions","organizations_url":"https://api.github.com/users/alcaeus/orgs","repos_url":"https://api.github.com/users/alcaeus/repos","events_url":"https://api.github.com/users/alcaeus/events{/privacy}","received_events_url":"https://api.github.com/users/alcaeus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alcaeus/mongodb-odm","description":"Doctrine MongoDB Object Document Mapper (ODM)","fork":true,"url":"https://api.github.com/repos/alcaeus/mongodb-odm","forks_url":"https://api.github.com/repos/alcaeus/mongodb-odm/forks","keys_url":"https://api.github.com/repos/alcaeus/mongodb-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alcaeus/mongodb-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alcaeus/mongodb-odm/teams","hooks_url":"https://api.github.com/repos/alcaeus/mongodb-odm/hooks","issue_events_url":"https://api.github.com/repos/alcaeus/mongodb-odm/issues/events{/number}","events_url":"https://api.github.com/repos/alcaeus/mongodb-odm/events","assignees_url":"https://api.github.com/repos/alcaeus/mongodb-odm/assignees{/user}","branches_url":"https://api.github.com/repos/alcaeus/mongodb-odm/branches{/branch}","tags_url":"https://api.github.com/repos/alcaeus/mongodb-odm/tags","blobs_url":"https://api.github.com/repos/alcaeus/mongodb-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alcaeus/mongodb-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alcaeus/mongodb-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/alcaeus/mongodb-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alcaeus/mongodb-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/alcaeus/mongodb-odm/languages","stargazers_url":"https://api.github.com/repos/alcaeus/mongodb-odm/stargazers","contributors_url":"https://api.github.com/repos/alcaeus/mongodb-odm/contributors","subscribers_url":"https://api.github.com/repos/alcaeus/mongodb-odm/subscribers","subscription_url":"https://api.github.com/repos/alcaeus/mongodb-odm/subscription","commits_url":"https://api.github.com/repos/alcaeus/mongodb-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/alcaeus/mongodb-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/alcaeus/mongodb-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/alcaeus/mongodb-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/alcaeus/mongodb-odm/contents/{+path}","compare_url":"https://api.github.com/repos/alcaeus/mongodb-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alcaeus/mongodb-odm/merges","archive_url":"https://api.github.com/repos/alcaeus/mongodb-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alcaeus/mongodb-odm/downloads","issues_url":"https://api.github.com/repos/alcaeus/mongodb-odm/issues{/number}","pulls_url":"https://api.github.com/repos/alcaeus/mongodb-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/alcaeus/mongodb-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/alcaeus/mongodb-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alcaeus/mongodb-odm/labels{/name}","releases_url":"https://api.github.com/repos/alcaeus/mongodb-odm/releases{/id}","deployments_url":"https://api.github.com/repos/alcaeus/mongodb-odm/deployments","created_at":"2016-01-02T13:57:36Z","updated_at":"2016-01-17T16:58:02Z","pushed_at":"2016-03-30T07:29:04Z","git_url":"git://github.com/alcaeus/mongodb-odm.git","ssh_url":"git@github.com:alcaeus/mongodb-odm.git","clone_url":"https://github.com/alcaeus/mongodb-odm.git","svn_url":"https://github.com/alcaeus/mongodb-odm","homepage":"http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/","size":7490,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"doctrine:master","ref":"master","sha":"c1e9777d1e083d819a354553522903b3b83a6f39","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}","deployments_url":"https://api.github.com/repos/doctrine/mongodb-odm/deployments","created_at":"2010-05-20T20:20:00Z","updated_at":"2016-04-10T15:35:52Z","pushed_at":"2016-04-06T16:46:10Z","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":9640,"stargazers_count":605,"watchers_count":605,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":356,"mirror_url":null,"open_issues_count":116,"forks":356,"open_issues":116,"watchers":605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385"},"html":{"href":"https://github.com/doctrine/mongodb-odm/pull/1385"},"issue":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1385"},"comments":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1385/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1385/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/1385/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/d464928519dc38e78c61affcd04cf0785f5657c8"}}}}