{"action":"created","comment":{"url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/comments/27054194","id":27054194,"diff_hunk":"@@ -66,6 +116,25 @@ module.exports = function (txid, spec) {\n     );\n   };\n \n+  /**\n+   * Handle the post of a new answer to a Samplestack question. The posted\n+   * answer is merged with an answer template object, a unique ID, contributor\n+   * information, and the current time. The resulting object is written to the\n+   * MarkLogic database. During the write, the answer count for the question is\n+   * incremented and the last activity date is updated.\n+   *\n+   * @param  {String} txid The transaction ID.\n+   * @param  {Object} contributor Contributor object. Example:\n+   *   {\"id\":\"cf99542d-f024-4478-a6dc-7e723a51b040\",\n+   *    \"displayName\":\"JoeUser\"}\n+   * @param  {String} questionId The question ID.\n+   * @param  {Object} spec Answer content with \"comments\" and \"text\" properties.\n+   * The comments property is an empty array (TODO Why? Remove?). Example:\n+   *   {\"comments\":[],","path":"appserver/node-express/lib/db-client/qnaDoc/patch.js","position":99,"original_position":99,"commit_id":"6d8d2c71662e30c233a8885272536836c41a6cbc","original_commit_id":"6d8d2c71662e30c233a8885272536836c41a6cbc","user":{"login":"wooldridge","id":477757,"avatar_url":"https://avatars.githubusercontent.com/u/477757?v=3","gravatar_id":"","url":"https://api.github.com/users/wooldridge","html_url":"https://github.com/wooldridge","followers_url":"https://api.github.com/users/wooldridge/followers","following_url":"https://api.github.com/users/wooldridge/following{/other_user}","gists_url":"https://api.github.com/users/wooldridge/gists{/gist_id}","starred_url":"https://api.github.com/users/wooldridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooldridge/subscriptions","organizations_url":"https://api.github.com/users/wooldridge/orgs","repos_url":"https://api.github.com/users/wooldridge/repos","events_url":"https://api.github.com/users/wooldridge/events{/privacy}","received_events_url":"https://api.github.com/users/wooldridge/received_events","type":"User","site_admin":false},"body":"Thanks. I see that the spec (and thus the comments) comes in (from the routing) from the req object, and the empty comments is not of db-client concern, so not necessary to include specifics here. ","created_at":"2015-03-24T17:49:26Z","updated_at":"2015-03-24T17:49:26Z","html_url":"https://github.com/laurelnaiad/marklogic-samplestack/pull/74#discussion_r27054194","pull_request_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/comments/27054194"},"html":{"href":"https://github.com/laurelnaiad/marklogic-samplestack/pull/74#discussion_r27054194"},"pull_request":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74","id":31791056,"html_url":"https://github.com/laurelnaiad/marklogic-samplestack/pull/74","diff_url":"https://github.com/laurelnaiad/marklogic-samplestack/pull/74.diff","patch_url":"https://github.com/laurelnaiad/marklogic-samplestack/pull/74.patch","issue_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues/74","number":74,"state":"open","locked":false,"title":"node: documentation for add question, answer question, and vote code","user":{"login":"wooldridge","id":477757,"avatar_url":"https://avatars.githubusercontent.com/u/477757?v=3","gravatar_id":"","url":"https://api.github.com/users/wooldridge","html_url":"https://github.com/wooldridge","followers_url":"https://api.github.com/users/wooldridge/followers","following_url":"https://api.github.com/users/wooldridge/following{/other_user}","gists_url":"https://api.github.com/users/wooldridge/gists{/gist_id}","starred_url":"https://api.github.com/users/wooldridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooldridge/subscriptions","organizations_url":"https://api.github.com/users/wooldridge/orgs","repos_url":"https://api.github.com/users/wooldridge/repos","events_url":"https://api.github.com/users/wooldridge/events{/privacy}","received_events_url":"https://api.github.com/users/wooldridge/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-24T01:53:19Z","updated_at":"2015-03-24T17:49:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09774c35ddea83205a29c9046e953c09e2afe68d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74/commits","review_comments_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74/comments","review_comment_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues/74/comments","statuses_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/statuses/6d8d2c71662e30c233a8885272536836c41a6cbc","head":{"label":"wooldridge:node-develop-documentation","ref":"node-develop-documentation","sha":"6d8d2c71662e30c233a8885272536836c41a6cbc","user":{"login":"wooldridge","id":477757,"avatar_url":"https://avatars.githubusercontent.com/u/477757?v=3","gravatar_id":"","url":"https://api.github.com/users/wooldridge","html_url":"https://github.com/wooldridge","followers_url":"https://api.github.com/users/wooldridge/followers","following_url":"https://api.github.com/users/wooldridge/following{/other_user}","gists_url":"https://api.github.com/users/wooldridge/gists{/gist_id}","starred_url":"https://api.github.com/users/wooldridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooldridge/subscriptions","organizations_url":"https://api.github.com/users/wooldridge/orgs","repos_url":"https://api.github.com/users/wooldridge/repos","events_url":"https://api.github.com/users/wooldridge/events{/privacy}","received_events_url":"https://api.github.com/users/wooldridge/received_events","type":"User","site_admin":false},"repo":{"id":23125430,"name":"marklogic-samplestack","full_name":"wooldridge/marklogic-samplestack","owner":{"login":"wooldridge","id":477757,"avatar_url":"https://avatars.githubusercontent.com/u/477757?v=3","gravatar_id":"","url":"https://api.github.com/users/wooldridge","html_url":"https://github.com/wooldridge","followers_url":"https://api.github.com/users/wooldridge/followers","following_url":"https://api.github.com/users/wooldridge/following{/other_user}","gists_url":"https://api.github.com/users/wooldridge/gists{/gist_id}","starred_url":"https://api.github.com/users/wooldridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wooldridge/subscriptions","organizations_url":"https://api.github.com/users/wooldridge/orgs","repos_url":"https://api.github.com/users/wooldridge/repos","events_url":"https://api.github.com/users/wooldridge/events{/privacy}","received_events_url":"https://api.github.com/users/wooldridge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wooldridge/marklogic-samplestack","description":"A sample implementation of  the MarkLogic Reference Architecture","fork":true,"url":"https://api.github.com/repos/wooldridge/marklogic-samplestack","forks_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/forks","keys_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/teams","hooks_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/hooks","issue_events_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/issues/events{/number}","events_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/events","assignees_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/assignees{/user}","branches_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/branches{/branch}","tags_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/tags","blobs_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/git/refs{/sha}","trees_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/statuses/{sha}","languages_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/languages","stargazers_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/stargazers","contributors_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/contributors","subscribers_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/subscribers","subscription_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/subscription","commits_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/commits{/sha}","git_commits_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/git/commits{/sha}","comments_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/comments{/number}","issue_comment_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/issues/comments{/number}","contents_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/contents/{+path}","compare_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/merges","archive_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/downloads","issues_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/issues{/number}","pulls_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/pulls{/number}","milestones_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/milestones{/number}","notifications_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/labels{/name}","releases_url":"https://api.github.com/repos/wooldridge/marklogic-samplestack/releases{/id}","created_at":"2014-08-19T20:51:29Z","updated_at":"2014-08-19T21:48:21Z","pushed_at":"2015-03-24T01:51:14Z","git_url":"git://github.com/wooldridge/marklogic-samplestack.git","ssh_url":"git@github.com:wooldridge/marklogic-samplestack.git","clone_url":"https://github.com/wooldridge/marklogic-samplestack.git","svn_url":"https://github.com/wooldridge/marklogic-samplestack","homepage":"","size":13755,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"laurelnaiad:node-develop","ref":"node-develop","sha":"9ff2ba6cf4e8e6f872add0f989480ec0c6c5ab0c","user":{"login":"laurelnaiad","id":4078946,"avatar_url":"https://avatars.githubusercontent.com/u/4078946?v=3","gravatar_id":"","url":"https://api.github.com/users/laurelnaiad","html_url":"https://github.com/laurelnaiad","followers_url":"https://api.github.com/users/laurelnaiad/followers","following_url":"https://api.github.com/users/laurelnaiad/following{/other_user}","gists_url":"https://api.github.com/users/laurelnaiad/gists{/gist_id}","starred_url":"https://api.github.com/users/laurelnaiad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurelnaiad/subscriptions","organizations_url":"https://api.github.com/users/laurelnaiad/orgs","repos_url":"https://api.github.com/users/laurelnaiad/repos","events_url":"https://api.github.com/users/laurelnaiad/events{/privacy}","received_events_url":"https://api.github.com/users/laurelnaiad/received_events","type":"User","site_admin":false},"repo":{"id":23123488,"name":"marklogic-samplestack","full_name":"laurelnaiad/marklogic-samplestack","owner":{"login":"laurelnaiad","id":4078946,"avatar_url":"https://avatars.githubusercontent.com/u/4078946?v=3","gravatar_id":"","url":"https://api.github.com/users/laurelnaiad","html_url":"https://github.com/laurelnaiad","followers_url":"https://api.github.com/users/laurelnaiad/followers","following_url":"https://api.github.com/users/laurelnaiad/following{/other_user}","gists_url":"https://api.github.com/users/laurelnaiad/gists{/gist_id}","starred_url":"https://api.github.com/users/laurelnaiad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laurelnaiad/subscriptions","organizations_url":"https://api.github.com/users/laurelnaiad/orgs","repos_url":"https://api.github.com/users/laurelnaiad/repos","events_url":"https://api.github.com/users/laurelnaiad/events{/privacy}","received_events_url":"https://api.github.com/users/laurelnaiad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/laurelnaiad/marklogic-samplestack","description":"A sample implementation of  the MarkLogic Reference Architecture","fork":true,"url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack","forks_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/forks","keys_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/teams","hooks_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/hooks","issue_events_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues/events{/number}","events_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/events","assignees_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/assignees{/user}","branches_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/branches{/branch}","tags_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/tags","blobs_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/git/refs{/sha}","trees_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/statuses/{sha}","languages_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/languages","stargazers_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/stargazers","contributors_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/contributors","subscribers_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/subscribers","subscription_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/subscription","commits_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/commits{/sha}","git_commits_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/git/commits{/sha}","comments_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/comments{/number}","issue_comment_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues/comments{/number}","contents_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/contents/{+path}","compare_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/merges","archive_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/downloads","issues_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues{/number}","pulls_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls{/number}","milestones_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/milestones{/number}","notifications_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/labels{/name}","releases_url":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/releases{/id}","created_at":"2014-08-19T19:45:46Z","updated_at":"2015-03-05T15:43:31Z","pushed_at":"2015-03-24T01:53:19Z","git_url":"git://github.com/laurelnaiad/marklogic-samplestack.git","ssh_url":"git@github.com:laurelnaiad/marklogic-samplestack.git","clone_url":"https://github.com/laurelnaiad/marklogic-samplestack.git","svn_url":"https://github.com/laurelnaiad/marklogic-samplestack","homepage":"","size":19447,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"browser-develop"}},"_links":{"self":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74"},"html":{"href":"https://github.com/laurelnaiad/marklogic-samplestack/pull/74"},"issue":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues/74"},"comments":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/laurelnaiad/marklogic-samplestack/statuses/6d8d2c71662e30c233a8885272536836c41a6cbc"}}}}