Revision 383936313361 () - Diff

Link to this snippet: https://friendpaste.com/7YB7OfpudslHY8zUqEOVLb
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
start_replication(Name) ->
CouchitDb = ?l2b(couch_config:get("couchit", "db", "couchit")),
{ok, RepDb} = couch_rep:ensure_rep_db_exists(),
RepDoc = {[
{<<"_id">>, couch_uuids:new()},
{<<"source">>, CouchitDb},
{<<"target">>, Name},
{<<"doc_ids">>, [<<"_design/couchit">>]},
{<<"continuous">>, true}
]},

couch_db:update_doc(RepDb, couch_doc:from_json_obj(RepDoc), []),
ok.