{"action":"created","comment":{"url":"https://api.github.com/repos/agco/hapi-harvester/pulls/comments/45722658","id":45722658,"diff_hunk":"@@ -17,11 +18,35 @@ module.exports = function() {\n         }\n     \n         function toJsonApiSingle(resource) {\n-            var mapped = _.mapKeys(resource, function (val, key) {\n-                if (key === '_id') return 'id'\n-                else return key\n-            });\n-            return _.omit(mapped, '__v')\n+            return _.chain(resource)\n+                .thru(_idToId)\n+                .thru(createResourceLinks)","path":"lib/adapters/mongodb/converters.js","position":21,"original_position":21,"commit_id":"bdb801d1798c005a1f432254ad2472d2c722cee7","original_commit_id":"bdb801d1798c005a1f432254ad2472d2c722cee7","user":{"login":"mavdi","id":767675,"avatar_url":"https://avatars.githubusercontent.com/u/767675?v=3","gravatar_id":"","url":"https://api.github.com/users/mavdi","html_url":"https://github.com/mavdi","followers_url":"https://api.github.com/users/mavdi/followers","following_url":"https://api.github.com/users/mavdi/following{/other_user}","gists_url":"https://api.github.com/users/mavdi/gists{/gist_id}","starred_url":"https://api.github.com/users/mavdi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavdi/subscriptions","organizations_url":"https://api.github.com/users/mavdi/orgs","repos_url":"https://api.github.com/users/mavdi/repos","events_url":"https://api.github.com/users/mavdi/events{/privacy}","received_events_url":"https://api.github.com/users/mavdi/received_events","type":"User","site_admin":false},"body":"Take this function out and place it in ```onPreResponse``` in ```plugin.js``` perhaps right after the includes: https://github.com/agco/hapi-harvester/blob/feature/AGCMD-41/lib/plugin.js#L181","created_at":"2015-11-24T11:18:17Z","updated_at":"2015-11-24T11:18:17Z","html_url":"https://github.com/agco/hapi-harvester/pull/9#discussion_r45722658","pull_request_url":"https://api.github.com/repos/agco/hapi-harvester/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/agco/hapi-harvester/pulls/comments/45722658"},"html":{"href":"https://github.com/agco/hapi-harvester/pull/9#discussion_r45722658"},"pull_request":{"href":"https://api.github.com/repos/agco/hapi-harvester/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/agco/hapi-harvester/pulls/9","id":51399954,"html_url":"https://github.com/agco/hapi-harvester/pull/9","diff_url":"https://github.com/agco/hapi-harvester/pull/9.diff","patch_url":"https://github.com/agco/hapi-harvester/pull/9.patch","issue_url":"https://api.github.com/repos/agco/hapi-harvester/issues/9","number":9,"state":"open","locked":false,"title":"Feature/agcmd 41","user":{"login":"broguinn","id":5201136,"avatar_url":"https://avatars.githubusercontent.com/u/5201136?v=3","gravatar_id":"","url":"https://api.github.com/users/broguinn","html_url":"https://github.com/broguinn","followers_url":"https://api.github.com/users/broguinn/followers","following_url":"https://api.github.com/users/broguinn/following{/other_user}","gists_url":"https://api.github.com/users/broguinn/gists{/gist_id}","starred_url":"https://api.github.com/users/broguinn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broguinn/subscriptions","organizations_url":"https://api.github.com/users/broguinn/orgs","repos_url":"https://api.github.com/users/broguinn/repos","events_url":"https://api.github.com/users/broguinn/events{/privacy}","received_events_url":"https://api.github.com/users/broguinn/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-20T19:50:35Z","updated_at":"2015-11-24T11:18:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"334b93e9b85213384f5190f2d7e4271759e5bde0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/agco/hapi-harvester/pulls/9/commits","review_comments_url":"https://api.github.com/repos/agco/hapi-harvester/pulls/9/comments","review_comment_url":"https://api.github.com/repos/agco/hapi-harvester/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agco/hapi-harvester/issues/9/comments","statuses_url":"https://api.github.com/repos/agco/hapi-harvester/statuses/bdb801d1798c005a1f432254ad2472d2c722cee7","head":{"label":"agco:feature/AGCMD-41","ref":"feature/AGCMD-41","sha":"bdb801d1798c005a1f432254ad2472d2c722cee7","user":{"login":"agco","id":8579835,"avatar_url":"https://avatars.githubusercontent.com/u/8579835?v=3","gravatar_id":"","url":"https://api.github.com/users/agco","html_url":"https://github.com/agco","followers_url":"https://api.github.com/users/agco/followers","following_url":"https://api.github.com/users/agco/following{/other_user}","gists_url":"https://api.github.com/users/agco/gists{/gist_id}","starred_url":"https://api.github.com/users/agco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agco/subscriptions","organizations_url":"https://api.github.com/users/agco/orgs","repos_url":"https://api.github.com/users/agco/repos","events_url":"https://api.github.com/users/agco/events{/privacy}","received_events_url":"https://api.github.com/users/agco/received_events","type":"Organization","site_admin":false},"repo":{"id":43944733,"name":"hapi-harvester","full_name":"agco/hapi-harvester","owner":{"login":"agco","id":8579835,"avatar_url":"https://avatars.githubusercontent.com/u/8579835?v=3","gravatar_id":"","url":"https://api.github.com/users/agco","html_url":"https://github.com/agco","followers_url":"https://api.github.com/users/agco/followers","following_url":"https://api.github.com/users/agco/following{/other_user}","gists_url":"https://api.github.com/users/agco/gists{/gist_id}","starred_url":"https://api.github.com/users/agco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agco/subscriptions","organizations_url":"https://api.github.com/users/agco/orgs","repos_url":"https://api.github.com/users/agco/repos","events_url":"https://api.github.com/users/agco/events{/privacy}","received_events_url":"https://api.github.com/users/agco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agco/hapi-harvester","description":"","fork":false,"url":"https://api.github.com/repos/agco/hapi-harvester","forks_url":"https://api.github.com/repos/agco/hapi-harvester/forks","keys_url":"https://api.github.com/repos/agco/hapi-harvester/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agco/hapi-harvester/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agco/hapi-harvester/teams","hooks_url":"https://api.github.com/repos/agco/hapi-harvester/hooks","issue_events_url":"https://api.github.com/repos/agco/hapi-harvester/issues/events{/number}","events_url":"https://api.github.com/repos/agco/hapi-harvester/events","assignees_url":"https://api.github.com/repos/agco/hapi-harvester/assignees{/user}","branches_url":"https://api.github.com/repos/agco/hapi-harvester/branches{/branch}","tags_url":"https://api.github.com/repos/agco/hapi-harvester/tags","blobs_url":"https://api.github.com/repos/agco/hapi-harvester/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agco/hapi-harvester/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agco/hapi-harvester/git/refs{/sha}","trees_url":"https://api.github.com/repos/agco/hapi-harvester/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agco/hapi-harvester/statuses/{sha}","languages_url":"https://api.github.com/repos/agco/hapi-harvester/languages","stargazers_url":"https://api.github.com/repos/agco/hapi-harvester/stargazers","contributors_url":"https://api.github.com/repos/agco/hapi-harvester/contributors","subscribers_url":"https://api.github.com/repos/agco/hapi-harvester/subscribers","subscription_url":"https://api.github.com/repos/agco/hapi-harvester/subscription","commits_url":"https://api.github.com/repos/agco/hapi-harvester/commits{/sha}","git_commits_url":"https://api.github.com/repos/agco/hapi-harvester/git/commits{/sha}","comments_url":"https://api.github.com/repos/agco/hapi-harvester/comments{/number}","issue_comment_url":"https://api.github.com/repos/agco/hapi-harvester/issues/comments{/number}","contents_url":"https://api.github.com/repos/agco/hapi-harvester/contents/{+path}","compare_url":"https://api.github.com/repos/agco/hapi-harvester/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agco/hapi-harvester/merges","archive_url":"https://api.github.com/repos/agco/hapi-harvester/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agco/hapi-harvester/downloads","issues_url":"https://api.github.com/repos/agco/hapi-harvester/issues{/number}","pulls_url":"https://api.github.com/repos/agco/hapi-harvester/pulls{/number}","milestones_url":"https://api.github.com/repos/agco/hapi-harvester/milestones{/number}","notifications_url":"https://api.github.com/repos/agco/hapi-harvester/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agco/hapi-harvester/labels{/name}","releases_url":"https://api.github.com/repos/agco/hapi-harvester/releases{/id}","created_at":"2015-10-09T09:05:49Z","updated_at":"2015-10-26T08:44:16Z","pushed_at":"2015-11-23T13:58:52Z","git_url":"git://github.com/agco/hapi-harvester.git","ssh_url":"git@github.com:agco/hapi-harvester.git","clone_url":"https://github.com/agco/hapi-harvester.git","svn_url":"https://github.com/agco/hapi-harvester","homepage":null,"size":103,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"develop"}},"base":{"label":"agco:develop","ref":"develop","sha":"373a7367b3a8d6e3ecccd5d446fa80e38c2e7a59","user":{"login":"agco","id":8579835,"avatar_url":"https://avatars.githubusercontent.com/u/8579835?v=3","gravatar_id":"","url":"https://api.github.com/users/agco","html_url":"https://github.com/agco","followers_url":"https://api.github.com/users/agco/followers","following_url":"https://api.github.com/users/agco/following{/other_user}","gists_url":"https://api.github.com/users/agco/gists{/gist_id}","starred_url":"https://api.github.com/users/agco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agco/subscriptions","organizations_url":"https://api.github.com/users/agco/orgs","repos_url":"https://api.github.com/users/agco/repos","events_url":"https://api.github.com/users/agco/events{/privacy}","received_events_url":"https://api.github.com/users/agco/received_events","type":"Organization","site_admin":false},"repo":{"id":43944733,"name":"hapi-harvester","full_name":"agco/hapi-harvester","owner":{"login":"agco","id":8579835,"avatar_url":"https://avatars.githubusercontent.com/u/8579835?v=3","gravatar_id":"","url":"https://api.github.com/users/agco","html_url":"https://github.com/agco","followers_url":"https://api.github.com/users/agco/followers","following_url":"https://api.github.com/users/agco/following{/other_user}","gists_url":"https://api.github.com/users/agco/gists{/gist_id}","starred_url":"https://api.github.com/users/agco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agco/subscriptions","organizations_url":"https://api.github.com/users/agco/orgs","repos_url":"https://api.github.com/users/agco/repos","events_url":"https://api.github.com/users/agco/events{/privacy}","received_events_url":"https://api.github.com/users/agco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agco/hapi-harvester","description":"","fork":false,"url":"https://api.github.com/repos/agco/hapi-harvester","forks_url":"https://api.github.com/repos/agco/hapi-harvester/forks","keys_url":"https://api.github.com/repos/agco/hapi-harvester/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agco/hapi-harvester/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agco/hapi-harvester/teams","hooks_url":"https://api.github.com/repos/agco/hapi-harvester/hooks","issue_events_url":"https://api.github.com/repos/agco/hapi-harvester/issues/events{/number}","events_url":"https://api.github.com/repos/agco/hapi-harvester/events","assignees_url":"https://api.github.com/repos/agco/hapi-harvester/assignees{/user}","branches_url":"https://api.github.com/repos/agco/hapi-harvester/branches{/branch}","tags_url":"https://api.github.com/repos/agco/hapi-harvester/tags","blobs_url":"https://api.github.com/repos/agco/hapi-harvester/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agco/hapi-harvester/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agco/hapi-harvester/git/refs{/sha}","trees_url":"https://api.github.com/repos/agco/hapi-harvester/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agco/hapi-harvester/statuses/{sha}","languages_url":"https://api.github.com/repos/agco/hapi-harvester/languages","stargazers_url":"https://api.github.com/repos/agco/hapi-harvester/stargazers","contributors_url":"https://api.github.com/repos/agco/hapi-harvester/contributors","subscribers_url":"https://api.github.com/repos/agco/hapi-harvester/subscribers","subscription_url":"https://api.github.com/repos/agco/hapi-harvester/subscription","commits_url":"https://api.github.com/repos/agco/hapi-harvester/commits{/sha}","git_commits_url":"https://api.github.com/repos/agco/hapi-harvester/git/commits{/sha}","comments_url":"https://api.github.com/repos/agco/hapi-harvester/comments{/number}","issue_comment_url":"https://api.github.com/repos/agco/hapi-harvester/issues/comments{/number}","contents_url":"https://api.github.com/repos/agco/hapi-harvester/contents/{+path}","compare_url":"https://api.github.com/repos/agco/hapi-harvester/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agco/hapi-harvester/merges","archive_url":"https://api.github.com/repos/agco/hapi-harvester/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agco/hapi-harvester/downloads","issues_url":"https://api.github.com/repos/agco/hapi-harvester/issues{/number}","pulls_url":"https://api.github.com/repos/agco/hapi-harvester/pulls{/number}","milestones_url":"https://api.github.com/repos/agco/hapi-harvester/milestones{/number}","notifications_url":"https://api.github.com/repos/agco/hapi-harvester/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agco/hapi-harvester/labels{/name}","releases_url":"https://api.github.com/repos/agco/hapi-harvester/releases{/id}","created_at":"2015-10-09T09:05:49Z","updated_at":"2015-10-26T08:44:16Z","pushed_at":"2015-11-23T13:58:52Z","git_url":"git://github.com/agco/hapi-harvester.git","ssh_url":"git@github.com:agco/hapi-harvester.git","clone_url":"https://github.com/agco/hapi-harvester.git","svn_url":"https://github.com/agco/hapi-harvester","homepage":null,"size":103,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/agco/hapi-harvester/pulls/9"},"html":{"href":"https://github.com/agco/hapi-harvester/pull/9"},"issue":{"href":"https://api.github.com/repos/agco/hapi-harvester/issues/9"},"comments":{"href":"https://api.github.com/repos/agco/hapi-harvester/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/agco/hapi-harvester/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/agco/hapi-harvester/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agco/hapi-harvester/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/agco/hapi-harvester/statuses/bdb801d1798c005a1f432254ad2472d2c722cee7"}}}}