From e3610fa481b5c506ca0b69f49a6f350fce8b3399 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sun, 11 Oct 2009 05:49:19 +0000 Subject: add create_target:true option to _replicate that creates the target database git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@824029 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share/www/script/couch.js') diff --git a/share/www/script/couch.js b/share/www/script/couch.js index f6c1199a..86465c95 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -387,9 +387,12 @@ CouchDB.getVersion = function() { CouchDB.replicate = function(source, target, rep_options) { rep_options = rep_options || {}; var headers = rep_options.headers || {}; + var body = rep_options.body || {}; + body.source = source; + body.target = target; CouchDB.last_req = CouchDB.request("POST", "/_replicate", { headers: headers, - body: JSON.stringify({source: source, target: target}) + body: JSON.stringify(body) }); CouchDB.maybeThrowError(CouchDB.last_req); return JSON.parse(CouchDB.last_req.responseText); -- cgit v1.2.3