{"action":"created","comment":{"url":"https://api.github.com/repos/apache/couchdb-mango/pulls/comments/27700208","id":27700208,"diff_hunk":"@@ -80,6 +80,27 @@ handle_index_req(#httpd{method='POST', path_parts=[_, _]}=Req, Db) ->\n     end,\n \tchttpd:send_json(Req, {[{result, Status}, {id, Id}, {name, Name}]});\n \n+%% Essentially we just iterate through the list of ddoc ids passed in and\n+%% delete one by one. If an error occurs, all previous documents will be\n+%% deleted, but an error will be thrown for the current ddoc id.\n+handle_index_req(#httpd{method='POST', path_parts=[_, <<\"_index\">>,\n+        <<\"_bulk_delete\">>]}=Req, Db) ->\n+    {ok, Opts} = mango_opts:validate_bulk_delete(chttpd:json_body_obj(Req)),\n+    Idxs = mango_idx:list(Db),\n+    DDocs = get_bulk_delete_ddocs(Opts),\n+    DelOpts = get_idx_w_opts(Opts),\n+    lists:foreach(fun(DDocId0) ->\n+        DDocId = convert_to_design_id(DDocId0),\n+        Filt = fun(Idx) ->","path":"src/mango_httpd.erl","position":null,"original_position":24,"commit_id":"985c952aa2274664107472675fe37eea105085b3","original_commit_id":"8ce9bf4baf28c35924bde049f7f2c3edc1b5cf11","user":{"login":"tonysun83","id":6991573,"avatar_url":"https://avatars.githubusercontent.com/u/6991573?v=3","gravatar_id":"","url":"https://api.github.com/users/tonysun83","html_url":"https://github.com/tonysun83","followers_url":"https://api.github.com/users/tonysun83/followers","following_url":"https://api.github.com/users/tonysun83/following{/other_user}","gists_url":"https://api.github.com/users/tonysun83/gists{/gist_id}","starred_url":"https://api.github.com/users/tonysun83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonysun83/subscriptions","organizations_url":"https://api.github.com/users/tonysun83/orgs","repos_url":"https://api.github.com/users/tonysun83/repos","events_url":"https://api.github.com/users/tonysun83/events{/privacy}","received_events_url":"https://api.github.com/users/tonysun83/received_events","type":"User","site_admin":false},"body":"With the latest commit, the bulk filter is a single line, so I don't think there is a need to specifically have a separate function to satisfy these two different calls. What do you think?","created_at":"2015-04-02T21:43:10Z","updated_at":"2015-04-02T21:43:10Z","html_url":"https://github.com/apache/couchdb-mango/pull/4#discussion_r27700208","pull_request_url":"https://api.github.com/repos/apache/couchdb-mango/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/apache/couchdb-mango/pulls/comments/27700208"},"html":{"href":"https://github.com/apache/couchdb-mango/pull/4#discussion_r27700208"},"pull_request":{"href":"https://api.github.com/repos/apache/couchdb-mango/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/apache/couchdb-mango/pulls/4","id":32490355,"html_url":"https://github.com/apache/couchdb-mango/pull/4","diff_url":"https://github.com/apache/couchdb-mango/pull/4.diff","patch_url":"https://github.com/apache/couchdb-mango/pull/4.patch","issue_url":"https://api.github.com/repos/apache/couchdb-mango/issues/4","number":4,"state":"open","locked":false,"title":"Enable Bulk Deletes","user":{"login":"tonysun83","id":6991573,"avatar_url":"https://avatars.githubusercontent.com/u/6991573?v=3","gravatar_id":"","url":"https://api.github.com/users/tonysun83","html_url":"https://github.com/tonysun83","followers_url":"https://api.github.com/users/tonysun83/followers","following_url":"https://api.github.com/users/tonysun83/following{/other_user}","gists_url":"https://api.github.com/users/tonysun83/gists{/gist_id}","starred_url":"https://api.github.com/users/tonysun83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonysun83/subscriptions","organizations_url":"https://api.github.com/users/tonysun83/orgs","repos_url":"https://api.github.com/users/tonysun83/repos","events_url":"https://api.github.com/users/tonysun83/events{/privacy}","received_events_url":"https://api.github.com/users/tonysun83/received_events","type":"User","site_admin":false},"body":"Add _bulk_delete path to _index so that users can bulk delete\r\nindexes via POST. Users will pass in a list of docids via the POST body.\r\nWe delete each index one by one until an error is thrown or all indexes\r\nin the list are deleted.\r\n\r\nFixes COUCHDB-2651","created_at":"2015-04-02T08:03:01Z","updated_at":"2015-04-02T21:43:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c991bdb10a1d61fe9ab489c9fa9cc844aa8c5e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/couchdb-mango/pulls/4/commits","review_comments_url":"https://api.github.com/repos/apache/couchdb-mango/pulls/4/comments","review_comment_url":"https://api.github.com/repos/apache/couchdb-mango/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/couchdb-mango/issues/4/comments","statuses_url":"https://api.github.com/repos/apache/couchdb-mango/statuses/985c952aa2274664107472675fe37eea105085b3","head":{"label":"apache:2651-delete-bulk-docs","ref":"2651-delete-bulk-docs","sha":"985c952aa2274664107472675fe37eea105085b3","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":30287956,"name":"couchdb-mango","full_name":"apache/couchdb-mango","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/couchdb-mango","description":"Mirror of Apache CouchDB Mango","fork":false,"url":"https://api.github.com/repos/apache/couchdb-mango","forks_url":"https://api.github.com/repos/apache/couchdb-mango/forks","keys_url":"https://api.github.com/repos/apache/couchdb-mango/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/couchdb-mango/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/couchdb-mango/teams","hooks_url":"https://api.github.com/repos/apache/couchdb-mango/hooks","issue_events_url":"https://api.github.com/repos/apache/couchdb-mango/issues/events{/number}","events_url":"https://api.github.com/repos/apache/couchdb-mango/events","assignees_url":"https://api.github.com/repos/apache/couchdb-mango/assignees{/user}","branches_url":"https://api.github.com/repos/apache/couchdb-mango/branches{/branch}","tags_url":"https://api.github.com/repos/apache/couchdb-mango/tags","blobs_url":"https://api.github.com/repos/apache/couchdb-mango/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/couchdb-mango/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/couchdb-mango/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/couchdb-mango/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/couchdb-mango/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/couchdb-mango/languages","stargazers_url":"https://api.github.com/repos/apache/couchdb-mango/stargazers","contributors_url":"https://api.github.com/repos/apache/couchdb-mango/contributors","subscribers_url":"https://api.github.com/repos/apache/couchdb-mango/subscribers","subscription_url":"https://api.github.com/repos/apache/couchdb-mango/subscription","commits_url":"https://api.github.com/repos/apache/couchdb-mango/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/couchdb-mango/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/couchdb-mango/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/couchdb-mango/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/couchdb-mango/contents/{+path}","compare_url":"https://api.github.com/repos/apache/couchdb-mango/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/couchdb-mango/merges","archive_url":"https://api.github.com/repos/apache/couchdb-mango/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/couchdb-mango/downloads","issues_url":"https://api.github.com/repos/apache/couchdb-mango/issues{/number}","pulls_url":"https://api.github.com/repos/apache/couchdb-mango/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/couchdb-mango/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/couchdb-mango/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/couchdb-mango/labels{/name}","releases_url":"https://api.github.com/repos/apache/couchdb-mango/releases{/id}","created_at":"2015-02-04T08:00:05Z","updated_at":"2015-03-31T15:51:04Z","pushed_at":"2015-04-02T21:40:30Z","git_url":"git://github.com/apache/couchdb-mango.git","ssh_url":"git@github.com:apache/couchdb-mango.git","clone_url":"https://github.com/apache/couchdb-mango.git","svn_url":"https://github.com/apache/couchdb-mango","homepage":null,"size":520,"stargazers_count":15,"watchers_count":15,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":"git://git.apache.org/couchdb-mango.git","open_issues_count":1,"forks":0,"open_issues":1,"watchers":15,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"f6d4901bc5717c17397d8baec27e3501d92c1fdb","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":30287956,"name":"couchdb-mango","full_name":"apache/couchdb-mango","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/couchdb-mango","description":"Mirror of Apache CouchDB Mango","fork":false,"url":"https://api.github.com/repos/apache/couchdb-mango","forks_url":"https://api.github.com/repos/apache/couchdb-mango/forks","keys_url":"https://api.github.com/repos/apache/couchdb-mango/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/couchdb-mango/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/couchdb-mango/teams","hooks_url":"https://api.github.com/repos/apache/couchdb-mango/hooks","issue_events_url":"https://api.github.com/repos/apache/couchdb-mango/issues/events{/number}","events_url":"https://api.github.com/repos/apache/couchdb-mango/events","assignees_url":"https://api.github.com/repos/apache/couchdb-mango/assignees{/user}","branches_url":"https://api.github.com/repos/apache/couchdb-mango/branches{/branch}","tags_url":"https://api.github.com/repos/apache/couchdb-mango/tags","blobs_url":"https://api.github.com/repos/apache/couchdb-mango/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/couchdb-mango/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/couchdb-mango/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/couchdb-mango/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/couchdb-mango/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/couchdb-mango/languages","stargazers_url":"https://api.github.com/repos/apache/couchdb-mango/stargazers","contributors_url":"https://api.github.com/repos/apache/couchdb-mango/contributors","subscribers_url":"https://api.github.com/repos/apache/couchdb-mango/subscribers","subscription_url":"https://api.github.com/repos/apache/couchdb-mango/subscription","commits_url":"https://api.github.com/repos/apache/couchdb-mango/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/couchdb-mango/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/couchdb-mango/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/couchdb-mango/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/couchdb-mango/contents/{+path}","compare_url":"https://api.github.com/repos/apache/couchdb-mango/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/couchdb-mango/merges","archive_url":"https://api.github.com/repos/apache/couchdb-mango/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/couchdb-mango/downloads","issues_url":"https://api.github.com/repos/apache/couchdb-mango/issues{/number}","pulls_url":"https://api.github.com/repos/apache/couchdb-mango/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/couchdb-mango/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/couchdb-mango/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/couchdb-mango/labels{/name}","releases_url":"https://api.github.com/repos/apache/couchdb-mango/releases{/id}","created_at":"2015-02-04T08:00:05Z","updated_at":"2015-03-31T15:51:04Z","pushed_at":"2015-04-02T21:40:30Z","git_url":"git://github.com/apache/couchdb-mango.git","ssh_url":"git@github.com:apache/couchdb-mango.git","clone_url":"https://github.com/apache/couchdb-mango.git","svn_url":"https://github.com/apache/couchdb-mango","homepage":null,"size":520,"stargazers_count":15,"watchers_count":15,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":"git://git.apache.org/couchdb-mango.git","open_issues_count":1,"forks":0,"open_issues":1,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/couchdb-mango/pulls/4"},"html":{"href":"https://github.com/apache/couchdb-mango/pull/4"},"issue":{"href":"https://api.github.com/repos/apache/couchdb-mango/issues/4"},"comments":{"href":"https://api.github.com/repos/apache/couchdb-mango/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/couchdb-mango/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/couchdb-mango/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/couchdb-mango/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/apache/couchdb-mango/statuses/985c952aa2274664107472675fe37eea105085b3"}}}}