diff options
author | Jan Lehnardt <jan@apache.org> | 2009-08-12 18:48:25 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2009-08-12 18:48:25 +0000 |
commit | d6cb0bc17d834675a69620940036490b909a4b0d (patch) | |
tree | acfcc1dc0c9acb7e27085f10fbecace4e2b5eace /share/www/script/couch.js | |
parent | a975795f527de1f535a4536e602aa9040d975e80 (diff) |
add native /db/_conflicts view, patch by Adam Kocolosk, closes COUCHDB-462
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@803663 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/couch.js')
-rw-r--r-- | share/www/script/couch.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js index f354f52a..af3bb8fb 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -191,10 +191,18 @@ function CouchDB(name, httpHeaders) { } this.allDocs = function(options,keys) { + return this.builtinView("_all_docs", options, keys) + } + + this.conflicts = function(options,keys) { + return this.builtinView("_conflicts", options, keys) + } + + this.builtinView = function(name, options, keys) { if(!keys) { - this.last_req = this.request("GET", this.uri + "_all_docs" + encodeOptions(options)); + this.last_req = this.request("GET", this.uri + name + encodeOptions(options)); } else { - this.last_req = this.request("POST", this.uri + "_all_docs" + encodeOptions(options), { + this.last_req = this.request("POST", this.uri + name + encodeOptions(options), { headers: {"Content-Type": "application/json"}, body: JSON.stringify({keys:keys}) }); |