couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anh <>
Subject Rewrite + List + View problem
Date Wed, 09 Jun 2010 15:32:42 GMT

I'm trying to use the rewrite handler to clean up a list function URL,
but doesn't seem to work correctly.  The view and list function work
fine without the rewrite.

The view and reduce output complex keys like so:


and the view and list URL work correctly using these parameters:


(Using vhosts) I'm trying to rewrite the ugly URL and parameters to be:

(where :owner is a numeric value)

The rewrite I wrote looks like this:

	"from": "/owner/:owner/list",
	"to": "_list/list/view",
	"method": "GET",
	"query": {
		"group": true,
		"startkey": [":owner", ""],
		"endkey": [":owner", "\\u9999"]

However, this is getting rewritten to the following:

'GET' /db/_design/temp/_list/list/view?startkey=%5B%22%3Aowner%22%2C%22%22%5D&endkey=%5B%22%3Aowner%22%2C%22%5C%5Cu9999%22%5D&group=true&owner=123456

which does not throw an error, but returns an empty view since the
URL-encoded keys do not match anything.

Is there some way to do this with CouchDB rewrites?  (Passing the
startkey and endkey parameters to the "nice" URL would defeat the
purpose of this rewrite)


View raw message