summaryrefslogtreecommitdiff
path: root/src/couchdb/mod_couch.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/mod_couch.erl')
-rw-r--r--src/couchdb/mod_couch.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/couchdb/mod_couch.erl b/src/couchdb/mod_couch.erl
index 8373dbe9..0d157b1e 100644
--- a/src/couchdb/mod_couch.erl
+++ b/src/couchdb/mod_couch.erl
@@ -195,6 +195,8 @@ do(#mod{method="POST"}=Mod, #uri_parts{db="_restart", doc=""}) ->
send_ok(Mod, 201);
do(#mod{method="POST"}=Mod, #uri_parts{doc="_missing_revs"}=Parts) ->
handle_missing_revs_request(Mod, Parts);
+do(#mod{method="POST"}=Mod, #uri_parts{doc="_compact"}=Parts) ->
+ handle_compact(Mod, Parts);
do(#mod{method="PUT"}=Mod, #uri_parts{doc=""}=Parts) ->
handle_db_create(Mod, Parts);
do(#mod{method="DELETE"}=Mod, #uri_parts{doc=""}=Parts) ->
@@ -487,6 +489,10 @@ handle_missing_revs_request(#mod{entity_body=RawJson}=Mod, Parts) ->
JsonResults = [{Id, list_to_tuple(Revs)} || {Id, Revs} <- Results],
send_json(Mod, 200, {obj, [{missing_revs, {obj, JsonResults}}]}).
+handle_compact(Mod, Parts) ->
+ ok = couch_db:start_compact(open_db(Parts)),
+ send_ok(Mod, 202).
+
handle_replication_request(#mod{entity_body=RawJson}=Mod) ->
{obj, Props} = cjson:decode(RawJson),
Src = proplists:get_value("source", Props),