{"action":"created","comment":{"url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/comments/31483798","id":31483798,"diff_hunk":"@@ -0,0 +1,101 @@\n+var h = require('../helper');\n+var async = require('async');\n+var Mongoose = require('mongoose');\n+var connection = Mongoose.connect('mongodb://127.0.0.1/hello_world')\n+\n+// Mongoose Setup\n+var WorldSchema = new Mongoose.Schema({\n+    id          : Number,\n+    randomNumber: Number\n+  }, {\n+    collection: 'world'\n+  });\n+var FortuneSchema = new Mongoose.Schema({\n+    id:      Number,\n+    message: String\n+  }, {\n+    collection: 'fortune'\n+  });\n+\n+var Worlds = connection.model('World', WorldSchema);\n+var Fortunes = connection.model('Fortune', FortuneSchema);\n+\n+function mongooseRandomWorld(callback) {\n+  Worlds.findOne({\n+    id: h.randomTfbNumber()\n+  }).exec(function (err, world) {\n+    callback(err, world);\n+  });\n+}\n+\n+function mongooseGetAllFortunes(callback) {\n+  Fortunes.find({}).exec(function (err, fortunes) {\n+    callback(err, fortunes);\n+  });","path":"frameworks/JavaScript/nodejs/handlers/mongoose.js","position":34,"original_position":34,"commit_id":"7dd237651f635cf42edc2fd6d642d6da30da7587","original_commit_id":"7dd237651f635cf42edc2fd6d642d6da30da7587","user":{"login":"ngryman","id":892048,"avatar_url":"https://avatars.githubusercontent.com/u/892048?v=3","gravatar_id":"","url":"https://api.github.com/users/ngryman","html_url":"https://github.com/ngryman","followers_url":"https://api.github.com/users/ngryman/followers","following_url":"https://api.github.com/users/ngryman/following{/other_user}","gists_url":"https://api.github.com/users/ngryman/gists{/gist_id}","starred_url":"https://api.github.com/users/ngryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngryman/subscriptions","organizations_url":"https://api.github.com/users/ngryman/orgs","repos_url":"https://api.github.com/users/ngryman/repos","events_url":"https://api.github.com/users/ngryman/events{/privacy}","received_events_url":"https://api.github.com/users/ngryman/received_events","type":"User","site_admin":false},"body":"Can be simplified by `exec(callback)`.","created_at":"2015-06-02T00:11:53Z","updated_at":"2015-06-02T00:11:53Z","html_url":"https://github.com/TechEmpower/FrameworkBenchmarks/pull/1635#discussion_r31483798","pull_request_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635","_links":{"self":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/comments/31483798"},"html":{"href":"https://github.com/TechEmpower/FrameworkBenchmarks/pull/1635#discussion_r31483798"},"pull_request":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635"}}},"pull_request":{"url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635","id":36540760,"html_url":"https://github.com/TechEmpower/FrameworkBenchmarks/pull/1635","diff_url":"https://github.com/TechEmpower/FrameworkBenchmarks/pull/1635.diff","patch_url":"https://github.com/TechEmpower/FrameworkBenchmarks/pull/1635.patch","issue_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues/1635","number":1635,"state":"open","locked":false,"title":"Improve JS frameworks","user":{"login":"zane-techempower","id":9422070,"avatar_url":"https://avatars.githubusercontent.com/u/9422070?v=3","gravatar_id":"","url":"https://api.github.com/users/zane-techempower","html_url":"https://github.com/zane-techempower","followers_url":"https://api.github.com/users/zane-techempower/followers","following_url":"https://api.github.com/users/zane-techempower/following{/other_user}","gists_url":"https://api.github.com/users/zane-techempower/gists{/gist_id}","starred_url":"https://api.github.com/users/zane-techempower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zane-techempower/subscriptions","organizations_url":"https://api.github.com/users/zane-techempower/orgs","repos_url":"https://api.github.com/users/zane-techempower/repos","events_url":"https://api.github.com/users/zane-techempower/events{/privacy}","received_events_url":"https://api.github.com/users/zane-techempower/received_events","type":"User","site_admin":false},"body":"_Addresses  #1586_\r\n\r\nTasks:\r\n* ~~[nodejs] Improve routing, no longer using harmful switches~~\r\n* ~~[nodejs] Refactor and organize code better~~\r\n* ~~[nodejs] Add fortunes test to the 4 database configurations~~\r\n* ~~[nodejs] Add redis tests~~\r\n* ~~refactor handlers out of main script~~\r\n\r\nWill address in another PR:\r\n* Add fortunes testing to other frameworks\r\n* Add redis tests to other frameworks\r\n\r\nMaking PR early, this is a work-in progress but should be passing every step of the way. Work has been done on plain nodejs so far.","created_at":"2015-05-29T20:12:55Z","updated_at":"2015-06-02T00:11:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a998dfe7889a97ec1ceb91031d8595d43b2d20ee","assignee":{"login":"zane-techempower","id":9422070,"avatar_url":"https://avatars.githubusercontent.com/u/9422070?v=3","gravatar_id":"","url":"https://api.github.com/users/zane-techempower","html_url":"https://github.com/zane-techempower","followers_url":"https://api.github.com/users/zane-techempower/followers","following_url":"https://api.github.com/users/zane-techempower/following{/other_user}","gists_url":"https://api.github.com/users/zane-techempower/gists{/gist_id}","starred_url":"https://api.github.com/users/zane-techempower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zane-techempower/subscriptions","organizations_url":"https://api.github.com/users/zane-techempower/orgs","repos_url":"https://api.github.com/users/zane-techempower/repos","events_url":"https://api.github.com/users/zane-techempower/events{/privacy}","received_events_url":"https://api.github.com/users/zane-techempower/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635/commits","review_comments_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635/comments","review_comment_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues/1635/comments","statuses_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/statuses/7dd237651f635cf42edc2fd6d642d6da30da7587","head":{"label":"zane-techempower:improve-JS","ref":"improve-JS","sha":"7dd237651f635cf42edc2fd6d642d6da30da7587","user":{"login":"zane-techempower","id":9422070,"avatar_url":"https://avatars.githubusercontent.com/u/9422070?v=3","gravatar_id":"","url":"https://api.github.com/users/zane-techempower","html_url":"https://github.com/zane-techempower","followers_url":"https://api.github.com/users/zane-techempower/followers","following_url":"https://api.github.com/users/zane-techempower/following{/other_user}","gists_url":"https://api.github.com/users/zane-techempower/gists{/gist_id}","starred_url":"https://api.github.com/users/zane-techempower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zane-techempower/subscriptions","organizations_url":"https://api.github.com/users/zane-techempower/orgs","repos_url":"https://api.github.com/users/zane-techempower/repos","events_url":"https://api.github.com/users/zane-techempower/events{/privacy}","received_events_url":"https://api.github.com/users/zane-techempower/received_events","type":"User","site_admin":false},"repo":{"id":25938471,"name":"FrameworkBenchmarks","full_name":"zane-techempower/FrameworkBenchmarks","owner":{"login":"zane-techempower","id":9422070,"avatar_url":"https://avatars.githubusercontent.com/u/9422070?v=3","gravatar_id":"","url":"https://api.github.com/users/zane-techempower","html_url":"https://github.com/zane-techempower","followers_url":"https://api.github.com/users/zane-techempower/followers","following_url":"https://api.github.com/users/zane-techempower/following{/other_user}","gists_url":"https://api.github.com/users/zane-techempower/gists{/gist_id}","starred_url":"https://api.github.com/users/zane-techempower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zane-techempower/subscriptions","organizations_url":"https://api.github.com/users/zane-techempower/orgs","repos_url":"https://api.github.com/users/zane-techempower/repos","events_url":"https://api.github.com/users/zane-techempower/events{/privacy}","received_events_url":"https://api.github.com/users/zane-techempower/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zane-techempower/FrameworkBenchmarks","description":"Source code for the framework benchmarking project","fork":true,"url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks","forks_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/forks","keys_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/teams","hooks_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/hooks","issue_events_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/issues/events{/number}","events_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/events","assignees_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/assignees{/user}","branches_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/branches{/branch}","tags_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/tags","blobs_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/git/refs{/sha}","trees_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/statuses/{sha}","languages_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/languages","stargazers_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/stargazers","contributors_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/contributors","subscribers_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/subscribers","subscription_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/subscription","commits_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/commits{/sha}","git_commits_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/git/commits{/sha}","comments_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/comments{/number}","issue_comment_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/issues/comments{/number}","contents_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/contents/{+path}","compare_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/merges","archive_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/downloads","issues_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/issues{/number}","pulls_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/pulls{/number}","milestones_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/milestones{/number}","notifications_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/labels{/name}","releases_url":"https://api.github.com/repos/zane-techempower/FrameworkBenchmarks/releases{/id}","created_at":"2014-10-29T19:50:08Z","updated_at":"2015-04-17T22:46:04Z","pushed_at":"2015-06-01T20:22:16Z","git_url":"git://github.com/zane-techempower/FrameworkBenchmarks.git","ssh_url":"git@github.com:zane-techempower/FrameworkBenchmarks.git","clone_url":"https://github.com/zane-techempower/FrameworkBenchmarks.git","svn_url":"https://github.com/zane-techempower/FrameworkBenchmarks","homepage":"http://www.techempower.com/benchmarks/","size":131182,"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":"TechEmpower:master","ref":"master","sha":"bb2bf1aa984cbcf406690f486069f029d9ded255","user":{"login":"TechEmpower","id":3910062,"avatar_url":"https://avatars.githubusercontent.com/u/3910062?v=3","gravatar_id":"","url":"https://api.github.com/users/TechEmpower","html_url":"https://github.com/TechEmpower","followers_url":"https://api.github.com/users/TechEmpower/followers","following_url":"https://api.github.com/users/TechEmpower/following{/other_user}","gists_url":"https://api.github.com/users/TechEmpower/gists{/gist_id}","starred_url":"https://api.github.com/users/TechEmpower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechEmpower/subscriptions","organizations_url":"https://api.github.com/users/TechEmpower/orgs","repos_url":"https://api.github.com/users/TechEmpower/repos","events_url":"https://api.github.com/users/TechEmpower/events{/privacy}","received_events_url":"https://api.github.com/users/TechEmpower/received_events","type":"Organization","site_admin":false},"repo":{"id":8957264,"name":"FrameworkBenchmarks","full_name":"TechEmpower/FrameworkBenchmarks","owner":{"login":"TechEmpower","id":3910062,"avatar_url":"https://avatars.githubusercontent.com/u/3910062?v=3","gravatar_id":"","url":"https://api.github.com/users/TechEmpower","html_url":"https://github.com/TechEmpower","followers_url":"https://api.github.com/users/TechEmpower/followers","following_url":"https://api.github.com/users/TechEmpower/following{/other_user}","gists_url":"https://api.github.com/users/TechEmpower/gists{/gist_id}","starred_url":"https://api.github.com/users/TechEmpower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechEmpower/subscriptions","organizations_url":"https://api.github.com/users/TechEmpower/orgs","repos_url":"https://api.github.com/users/TechEmpower/repos","events_url":"https://api.github.com/users/TechEmpower/events{/privacy}","received_events_url":"https://api.github.com/users/TechEmpower/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TechEmpower/FrameworkBenchmarks","description":"Source code for the framework benchmarking project","fork":false,"url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks","forks_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/forks","keys_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/teams","hooks_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/hooks","issue_events_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues/events{/number}","events_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/events","assignees_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/assignees{/user}","branches_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/branches{/branch}","tags_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/tags","blobs_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/git/refs{/sha}","trees_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/statuses/{sha}","languages_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/languages","stargazers_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/stargazers","contributors_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/contributors","subscribers_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/subscribers","subscription_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/subscription","commits_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/commits{/sha}","git_commits_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/git/commits{/sha}","comments_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/comments{/number}","issue_comment_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues/comments{/number}","contents_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/contents/{+path}","compare_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/merges","archive_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/downloads","issues_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues{/number}","pulls_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls{/number}","milestones_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/milestones{/number}","notifications_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/labels{/name}","releases_url":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/releases{/id}","created_at":"2013-03-22T17:33:54Z","updated_at":"2015-06-01T15:31:42Z","pushed_at":"2015-06-01T20:22:19Z","git_url":"git://github.com/TechEmpower/FrameworkBenchmarks.git","ssh_url":"git@github.com:TechEmpower/FrameworkBenchmarks.git","clone_url":"https://github.com/TechEmpower/FrameworkBenchmarks.git","svn_url":"https://github.com/TechEmpower/FrameworkBenchmarks","homepage":"http://www.techempower.com/benchmarks/","size":183794,"stargazers_count":1722,"watchers_count":1722,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":606,"mirror_url":null,"open_issues_count":209,"forks":606,"open_issues":209,"watchers":1722,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635"},"html":{"href":"https://github.com/TechEmpower/FrameworkBenchmarks/pull/1635"},"issue":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues/1635"},"comments":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/issues/1635/comments"},"review_comments":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635/comments"},"review_comment":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/pulls/1635/commits"},"statuses":{"href":"https://api.github.com/repos/TechEmpower/FrameworkBenchmarks/statuses/7dd237651f635cf42edc2fd6d642d6da30da7587"}}}}