couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taras Puchko <taras.puc...@gmail.com>
Subject Re: Passing matrix parameters to show and list
Date Tue, 07 Sep 2010 16:35:53 GMT
Thank you,

I just wanted to use matrix parameters [1] but query should work for me too.

[1] http://www.w3.org/DesignIssues/MatrixURIs.html

Cheers,
Taras

On Tue, Sep 7, 2010 at 7:11 PM, Benoit Chesneau <bchesneau@gmail.com> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message