From 9c27e4d7db0e2e6a1b458f8545f584fcfaea4ef2 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Mon, 7 Apr 2008 19:51:17 +0000 Subject: Compaction. Works, but still needs queueing and better handling for long reads/writes overlapping the compaction switchover. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@645661 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'share/www/script/couch.js') diff --git a/share/www/script/couch.js b/share/www/script/couch.js index 9815882a..f1544893 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -87,6 +87,9 @@ function CouchDB(name) { var result = JSON.parse(req.responseText); if (req.status != 201) throw result; + for(i in docs) { + docs[i]._rev = result.new_revs[i].rev; + } return result; } @@ -130,6 +133,14 @@ function CouchDB(name) { throw result; return result; } + + this.compact = function() { + var req = request("POST", this.uri + "_compact"); + var result = JSON.parse(req.responseText); + if (req.status != 202) + throw result; + return result; + } // Convert a options object to an url query string. // ex: {key:'value',key2:'value2'} becomes '?key="value"&key2="value2"' -- cgit v1.2.3