diff options
author | Paul Joseph Davis <davisp@apache.org> | 2010-11-10 19:44:05 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2010-11-10 19:44:05 +0000 |
commit | 9e53f467f89bc3942f8795f6d07f61d3f5115f88 (patch) | |
tree | 8480eaf7c98101322fc3b5fc00891685082fc944 /share/www/script/test/list_views.js | |
parent | 1f7e7cb5c22302788e232ce455fd0505f6420201 (diff) |
Support the keys parameter in GET requests.
You can now request a list of keys in the query string using a query
string like:
?keys=["foo", "bar"]
Your query string obviously needs to be properly escaped.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/list_views.js')
-rw-r--r-- | share/www/script/test/list_views.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js index 8578622a..e98a212e 100644 --- a/share/www/script/test/list_views.js +++ b/share/www/script/test/list_views.js @@ -327,6 +327,16 @@ couchTests.list_views = function(debug) { T(/FirstKey: 2/.test(xhr.responseText)); T(/LastKey: 7/.test(xhr.responseText)); + // multi-key fetch with GET + var xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/basicView" + + "?keys=[2,4,5,7]"); + + T(xhr.status == 200, "multi key"); + T(!(/Key: 1 /.test(xhr.responseText))); + T(/Key: 2/.test(xhr.responseText)); + T(/FirstKey: 2/.test(xhr.responseText)); + T(/LastKey: 7/.test(xhr.responseText)); + // no multi-key fetch allowed when group=false xhr = CouchDB.request("POST", "/test_suite_db/_design/lists/_list/simpleForm/withReduce?group=false", { body: '{"keys":[2,4,5,7]}' |