summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorBenoit Chesneau <benoitc@apache.org>2010-03-28 11:17:32 +0000
committerBenoit Chesneau <benoitc@apache.org>2010-03-28 11:17:32 +0000
commit8fdcf154634d3b0efedd64049df8f4006a1415cc (patch)
tree3ed7f7e07eb16c38691950ad92ab854fb5809a92 /share
parent41680a4491aa018660a990997925b7a9ad3c82e4 (diff)
allows more complex keys in the rewriter, so it could ease the
pagination (only array for now) : { "from": "simpleForm/complexView5/:a/:b", "to": "_list/simpleForm/complexView3", "query": { "key": [":a", ":b"] } }, git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@928374 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/rewrite.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/share/www/script/test/rewrite.js b/share/www/script/test/rewrite.js
index 034e1aee..848427be 100644
--- a/share/www/script/test/rewrite.js
+++ b/share/www/script/test/rewrite.js
@@ -132,6 +132,14 @@ couchTests.rewrite = function(debug) {
}
},
{
+ "from": "simpleForm/complexView5/:a/:b",
+ "to": "_list/simpleForm/complexView3",
+ "query": {
+ "key": [":a", ":b"]
+ }
+ },
+
+ {
"from": "uuids",
"to": "../../../_uuids"
}
@@ -211,6 +219,13 @@ couchTests.rewrite = function(debug) {
emit(doc.a, doc.string);
}
})
+ },
+ complexView3: {
+ map: stringFun(function(doc) {
+ if (doc.type == "complex") {
+ emit(doc.b, doc.string);
+ }
+ })
}
}
}
@@ -319,6 +334,9 @@ couchTests.rewrite = function(debug) {
T(xhr.status == 200, "with query params");
T(/Value: doc 5/.test(xhr.responseText));
+ xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_rewrite/simpleForm/complexView5/test/essai");
+ T(xhr.status == 200, "with query params");
+ T(/Value: doc 4/.test(xhr.responseText));
// test path relative to server