{"action":"created","comment":{"url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/comments/197687618","pull_request_review_id":131477389,"id":197687618,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzY4NzYxOA==","diff_hunk":"@@ -131,14 +137,26 @@ module.exports = app => {\n }\n \n // app/controller/user.js\n-exports.index = function* (ctx) {\n-  ctx.body = yield ctx.model.User.find({}); // get data from db1\n+const Controller = require('egg').Controller;\n+\n+class UserController extends Controller {\n+  async index() {\n+    this.ctx.body = await this.ctx.model.User.find({}).exec();","path":"README.md","position":10,"original_position":28,"commit_id":"036dd0ad44b2d09980d392c3daf1e847468754e4","original_commit_id":"036dd0ad44b2d09980d392c3daf1e847468754e4","user":{"login":"BodhiHu","id":3882561,"node_id":"MDQ6VXNlcjM4ODI1NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/3882561?v=4","gravatar_id":"","url":"https://api.github.com/users/BodhiHu","html_url":"https://github.com/BodhiHu","followers_url":"https://api.github.com/users/BodhiHu/followers","following_url":"https://api.github.com/users/BodhiHu/following{/other_user}","gists_url":"https://api.github.com/users/BodhiHu/gists{/gist_id}","starred_url":"https://api.github.com/users/BodhiHu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BodhiHu/subscriptions","organizations_url":"https://api.github.com/users/BodhiHu/orgs","repos_url":"https://api.github.com/users/BodhiHu/repos","events_url":"https://api.github.com/users/BodhiHu/events{/privacy}","received_events_url":"https://api.github.com/users/BodhiHu/received_events","type":"User","site_admin":false},"body":"```Model.find()```返回的是一个Query类型的Object. ```exec```之后才会返回Promise","created_at":"2018-06-25T06:11:31Z","updated_at":"2018-06-25T06:11:31Z","html_url":"https://github.com/eggjs/egg-mongoose/pull/19#discussion_r197687618","pull_request_url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/comments/197687618"},"html":{"href":"https://github.com/eggjs/egg-mongoose/pull/19#discussion_r197687618"},"pull_request":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19"}},"in_reply_to_id":194754333},"pull_request":{"url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19","id":182965083,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgyOTY1MDgz","html_url":"https://github.com/eggjs/egg-mongoose/pull/19","diff_url":"https://github.com/eggjs/egg-mongoose/pull/19.diff","patch_url":"https://github.com/eggjs/egg-mongoose/pull/19.patch","issue_url":"https://api.github.com/repos/eggjs/egg-mongoose/issues/19","number":19,"state":"open","locked":false,"title":"update README to use await/async instead of generator","user":{"login":"BodhiHu","id":3882561,"node_id":"MDQ6VXNlcjM4ODI1NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/3882561?v=4","gravatar_id":"","url":"https://api.github.com/users/BodhiHu","html_url":"https://github.com/BodhiHu","followers_url":"https://api.github.com/users/BodhiHu/followers","following_url":"https://api.github.com/users/BodhiHu/following{/other_user}","gists_url":"https://api.github.com/users/BodhiHu/gists{/gist_id}","starred_url":"https://api.github.com/users/BodhiHu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BodhiHu/subscriptions","organizations_url":"https://api.github.com/users/BodhiHu/orgs","repos_url":"https://api.github.com/users/BodhiHu/repos","events_url":"https://api.github.com/users/BodhiHu/events{/privacy}","received_events_url":"https://api.github.com/users/BodhiHu/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for your pull request. Please review below requirements.\r\nBug fixes and new features should include tests and possibly benchmarks.\r\nContributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md\r\n\r\n感谢您贡献代码。请确认下列 checklist 的完成情况。\r\nBug 修复和新功能必须包含测试，必要时请附上性能测试。\r\nContributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s). -->\r\n\r\n\r\n##### Description of change\r\n<!-- Provide a description of the change below this comment. -->\r\nHi 更新README里使用await/async，并且在执行查找操作时返回运行Query之后的数据，而不是Query Object：\r\n\r\n```\r\n    this.ctx.body = await this.ctx.model.User.find({}).exec();\r\n```\r\n","created_at":"2018-04-20T05:44:35Z","updated_at":"2018-06-25T06:11:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21cfddc20bfe0db2fce9444921a431427292d332","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jtyjty99999","id":893152,"node_id":"MDQ6VXNlcjg5MzE1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/893152?v=4","gravatar_id":"","url":"https://api.github.com/users/jtyjty99999","html_url":"https://github.com/jtyjty99999","followers_url":"https://api.github.com/users/jtyjty99999/followers","following_url":"https://api.github.com/users/jtyjty99999/following{/other_user}","gists_url":"https://api.github.com/users/jtyjty99999/gists{/gist_id}","starred_url":"https://api.github.com/users/jtyjty99999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtyjty99999/subscriptions","organizations_url":"https://api.github.com/users/jtyjty99999/orgs","repos_url":"https://api.github.com/users/jtyjty99999/repos","events_url":"https://api.github.com/users/jtyjty99999/events{/privacy}","received_events_url":"https://api.github.com/users/jtyjty99999/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19/commits","review_comments_url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19/comments","review_comment_url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eggjs/egg-mongoose/issues/19/comments","statuses_url":"https://api.github.com/repos/eggjs/egg-mongoose/statuses/036dd0ad44b2d09980d392c3daf1e847468754e4","head":{"label":"BodhiHu:master","ref":"master","sha":"036dd0ad44b2d09980d392c3daf1e847468754e4","user":{"login":"BodhiHu","id":3882561,"node_id":"MDQ6VXNlcjM4ODI1NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/3882561?v=4","gravatar_id":"","url":"https://api.github.com/users/BodhiHu","html_url":"https://github.com/BodhiHu","followers_url":"https://api.github.com/users/BodhiHu/followers","following_url":"https://api.github.com/users/BodhiHu/following{/other_user}","gists_url":"https://api.github.com/users/BodhiHu/gists{/gist_id}","starred_url":"https://api.github.com/users/BodhiHu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BodhiHu/subscriptions","organizations_url":"https://api.github.com/users/BodhiHu/orgs","repos_url":"https://api.github.com/users/BodhiHu/repos","events_url":"https://api.github.com/users/BodhiHu/events{/privacy}","received_events_url":"https://api.github.com/users/BodhiHu/received_events","type":"User","site_admin":false},"repo":{"id":130313021,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAzMTMwMjE=","name":"egg-mongoose","full_name":"BodhiHu/egg-mongoose","owner":{"login":"BodhiHu","id":3882561,"node_id":"MDQ6VXNlcjM4ODI1NjE=","avatar_url":"https://avatars1.githubusercontent.com/u/3882561?v=4","gravatar_id":"","url":"https://api.github.com/users/BodhiHu","html_url":"https://github.com/BodhiHu","followers_url":"https://api.github.com/users/BodhiHu/followers","following_url":"https://api.github.com/users/BodhiHu/following{/other_user}","gists_url":"https://api.github.com/users/BodhiHu/gists{/gist_id}","starred_url":"https://api.github.com/users/BodhiHu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BodhiHu/subscriptions","organizations_url":"https://api.github.com/users/BodhiHu/orgs","repos_url":"https://api.github.com/users/BodhiHu/repos","events_url":"https://api.github.com/users/BodhiHu/events{/privacy}","received_events_url":"https://api.github.com/users/BodhiHu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BodhiHu/egg-mongoose","description":null,"fork":true,"url":"https://api.github.com/repos/BodhiHu/egg-mongoose","forks_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/forks","keys_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/teams","hooks_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/hooks","issue_events_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/issues/events{/number}","events_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/events","assignees_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/assignees{/user}","branches_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/branches{/branch}","tags_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/tags","blobs_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/git/refs{/sha}","trees_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/statuses/{sha}","languages_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/languages","stargazers_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/stargazers","contributors_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/contributors","subscribers_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/subscribers","subscription_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/subscription","commits_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/commits{/sha}","git_commits_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/git/commits{/sha}","comments_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/comments{/number}","issue_comment_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/issues/comments{/number}","contents_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/contents/{+path}","compare_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/merges","archive_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/downloads","issues_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/issues{/number}","pulls_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/pulls{/number}","milestones_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/milestones{/number}","notifications_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/labels{/name}","releases_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/releases{/id}","deployments_url":"https://api.github.com/repos/BodhiHu/egg-mongoose/deployments","created_at":"2018-04-20T05:26:37Z","updated_at":"2018-06-07T08:48:17Z","pushed_at":"2018-06-07T08:48:15Z","git_url":"git://github.com/BodhiHu/egg-mongoose.git","ssh_url":"git@github.com:BodhiHu/egg-mongoose.git","clone_url":"https://github.com/BodhiHu/egg-mongoose.git","svn_url":"https://github.com/BodhiHu/egg-mongoose","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eggjs:master","ref":"master","sha":"a3405d60d0bf173a000706681cb6656b6ef6a7ed","user":{"login":"eggjs","id":15833670,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1ODMzNjcw","avatar_url":"https://avatars1.githubusercontent.com/u/15833670?v=4","gravatar_id":"","url":"https://api.github.com/users/eggjs","html_url":"https://github.com/eggjs","followers_url":"https://api.github.com/users/eggjs/followers","following_url":"https://api.github.com/users/eggjs/following{/other_user}","gists_url":"https://api.github.com/users/eggjs/gists{/gist_id}","starred_url":"https://api.github.com/users/eggjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggjs/subscriptions","organizations_url":"https://api.github.com/users/eggjs/orgs","repos_url":"https://api.github.com/users/eggjs/repos","events_url":"https://api.github.com/users/eggjs/events{/privacy}","received_events_url":"https://api.github.com/users/eggjs/received_events","type":"Organization","site_admin":false},"repo":{"id":82033770,"node_id":"MDEwOlJlcG9zaXRvcnk4MjAzMzc3MA==","name":"egg-mongoose","full_name":"eggjs/egg-mongoose","owner":{"login":"eggjs","id":15833670,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1ODMzNjcw","avatar_url":"https://avatars1.githubusercontent.com/u/15833670?v=4","gravatar_id":"","url":"https://api.github.com/users/eggjs","html_url":"https://github.com/eggjs","followers_url":"https://api.github.com/users/eggjs/followers","following_url":"https://api.github.com/users/eggjs/following{/other_user}","gists_url":"https://api.github.com/users/eggjs/gists{/gist_id}","starred_url":"https://api.github.com/users/eggjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggjs/subscriptions","organizations_url":"https://api.github.com/users/eggjs/orgs","repos_url":"https://api.github.com/users/eggjs/repos","events_url":"https://api.github.com/users/eggjs/events{/privacy}","received_events_url":"https://api.github.com/users/eggjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eggjs/egg-mongoose","description":null,"fork":false,"url":"https://api.github.com/repos/eggjs/egg-mongoose","forks_url":"https://api.github.com/repos/eggjs/egg-mongoose/forks","keys_url":"https://api.github.com/repos/eggjs/egg-mongoose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eggjs/egg-mongoose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eggjs/egg-mongoose/teams","hooks_url":"https://api.github.com/repos/eggjs/egg-mongoose/hooks","issue_events_url":"https://api.github.com/repos/eggjs/egg-mongoose/issues/events{/number}","events_url":"https://api.github.com/repos/eggjs/egg-mongoose/events","assignees_url":"https://api.github.com/repos/eggjs/egg-mongoose/assignees{/user}","branches_url":"https://api.github.com/repos/eggjs/egg-mongoose/branches{/branch}","tags_url":"https://api.github.com/repos/eggjs/egg-mongoose/tags","blobs_url":"https://api.github.com/repos/eggjs/egg-mongoose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eggjs/egg-mongoose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eggjs/egg-mongoose/git/refs{/sha}","trees_url":"https://api.github.com/repos/eggjs/egg-mongoose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eggjs/egg-mongoose/statuses/{sha}","languages_url":"https://api.github.com/repos/eggjs/egg-mongoose/languages","stargazers_url":"https://api.github.com/repos/eggjs/egg-mongoose/stargazers","contributors_url":"https://api.github.com/repos/eggjs/egg-mongoose/contributors","subscribers_url":"https://api.github.com/repos/eggjs/egg-mongoose/subscribers","subscription_url":"https://api.github.com/repos/eggjs/egg-mongoose/subscription","commits_url":"https://api.github.com/repos/eggjs/egg-mongoose/commits{/sha}","git_commits_url":"https://api.github.com/repos/eggjs/egg-mongoose/git/commits{/sha}","comments_url":"https://api.github.com/repos/eggjs/egg-mongoose/comments{/number}","issue_comment_url":"https://api.github.com/repos/eggjs/egg-mongoose/issues/comments{/number}","contents_url":"https://api.github.com/repos/eggjs/egg-mongoose/contents/{+path}","compare_url":"https://api.github.com/repos/eggjs/egg-mongoose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eggjs/egg-mongoose/merges","archive_url":"https://api.github.com/repos/eggjs/egg-mongoose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eggjs/egg-mongoose/downloads","issues_url":"https://api.github.com/repos/eggjs/egg-mongoose/issues{/number}","pulls_url":"https://api.github.com/repos/eggjs/egg-mongoose/pulls{/number}","milestones_url":"https://api.github.com/repos/eggjs/egg-mongoose/milestones{/number}","notifications_url":"https://api.github.com/repos/eggjs/egg-mongoose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eggjs/egg-mongoose/labels{/name}","releases_url":"https://api.github.com/repos/eggjs/egg-mongoose/releases{/id}","deployments_url":"https://api.github.com/repos/eggjs/egg-mongoose/deployments","created_at":"2017-02-15T07:44:24Z","updated_at":"2018-06-19T03:16:09Z","pushed_at":"2018-06-21T12:05:02Z","git_url":"git://github.com/eggjs/egg-mongoose.git","ssh_url":"git@github.com:eggjs/egg-mongoose.git","clone_url":"https://github.com/eggjs/egg-mongoose.git","svn_url":"https://github.com/eggjs/egg-mongoose","homepage":null,"size":34,"stargazers_count":125,"watchers_count":125,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":40,"open_issues":2,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19"},"html":{"href":"https://github.com/eggjs/egg-mongoose/pull/19"},"issue":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/issues/19"},"comments":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/eggjs/egg-mongoose/statuses/036dd0ad44b2d09980d392c3daf1e847468754e4"}},"author_association":"NONE"}}
{"actor":{"display_login":"BodhiHu"}}