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: Passing matrix parameters to show and list
Date Tue, 07 Sep 2010 16:11:26 GMT
On Tue, Sep 7, 2010 at 9:05 AM, Taras Puchko <taras.puchko@gmail.com> wrote:
> Hello,
>
> Does anyone know if it's possible to pass matrix parameters to show and list
> functions?
>
> I tried the following rewrite rule: {"from" : "myshow/:id/:extra",  "to":
> "_show/myshow/:id"}
>
> _rewrite/myshow/myid/path;m1=v1;m2=v2
> is translated to
> _show/myshow/myid?id=myid&extra=path%3Bm1%3Dv1%3Bm2%3Dv2
> so I have
> req.query.extra == "path;m1=v1;m2=v2" and can parse it manually.
>
> But if I use special characters things break, e.g. I want to pass "a;b=c" as
> a value for m2:
>
> _rewrite/myshow/myid/path;m1=v1;m2=a%3Bb%3Dc
> is translated to
> _show/myshow/myid?id=myid&extra=path%3Bm1%3Dv1%3Bm2%3Da%3Bb%3Dc
> so I have
> req.query.extra == "path;m1=v1;m2=a;b=c" and cannot parse it correctly.
>
> Thanks,
> Taras
>
You can do :

_rewrite/myshow/myid/path?m1=v1&m2="a;b=c"

then req.query should be ok.

- benoit

Mime
View raw message