incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: Rewriting a parameterized URL
Date Sat, 05 Jun 2010 22:42:09 GMT
On Sat, Jun 5, 2010 at 9:08 PM, Aurélien Bénel <aurelien.benel@utt.fr> wrote:
>> All parameters are passed after that or at least was.
>
> It is indeed the problem. They are passed *unchanged*. Therefore it is impossible to
"rewrite" them. Moreover, variables don't seem to be bound to parameters with the same name.
>
> As a matter of fact, after your first advice, I changed my rule to:
> [{
>  "from": "/item",
>  "to": "_list/mapping/kwic",
>  "query": {
>    "startkey": [":corpus"],
>    "endkey": [":corpus",{}]
>  }
> }]
>
> However,
> /cassandre/_design/cassandre/_rewrite/item?corpus=MISS
> was rewritten to
> /cassandre/_design/cassandre/_list/mapping/kwic?startkey=[":corpus"]&endkey=[":corpus",{}]&corpus=MISS
> instead of
> /cassandre/_design/cassandre/_list/mapping/kwic?startkey=["MISS"]&endkey=["MISS",{}]
>
>> I will check it later tonight anyway.
>
> Thanks.
>
>
> Aurélien
>
>

fixed in last trunk. Thanks :)

you can't pass arguments in "to" member. But any parameter passed in
uri should work now. I added proper unitest for that.

- benoît

Mime
View raw message