diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-03-09 19:52:54 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-03-09 19:52:54 +0000 |
commit | 610064aea6eb707fe3b6a68f7c93005ceac0a2ec (patch) | |
tree | 432a31e5c0561e10f9b1e4973c2741c5c777c1f1 /share/www/script/couch.js | |
parent | dd79e85bc9e4849df904498ca25ec56304440b5f (diff) |
merge design doc resource branch. breaking changes to _view query paths.
closes COUCHDB-280
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@751813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/couch.js')
-rw-r--r-- | share/www/script/couch.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js index 8a0d3d23..821fb694 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -142,12 +142,13 @@ function CouchDB(name, httpHeaders) { } this.view = function(viewname, options, keys) { + var viewParts = viewname.split('/'); + var viewPath = this.uri + "_design/" + viewParts[0] + "/_view/" + + viewParts[1] + encodeOptions(options); if(!keys) { - this.last_req = this.request("GET", this.uri + "_view/" + - viewname + encodeOptions(options)); + this.last_req = this.request("GET", viewPath); } else { - this.last_req = this.request("POST", this.uri + "_view/" + - viewname + encodeOptions(options), { + this.last_req = this.request("POST", viewPath, { headers: {"Content-Type": "application/json"}, body: JSON.stringify({keys:keys}) }); |