incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel Legnered <michel.legne...@gmail.com>
Subject Re: HTTP Rewrite Handler: Strings in queries
Date Sun, 09 Jan 2011 14:37:52 GMT
Thanks for the workaround Caolan!

A ticket has been filed: https://issues.apache.org/jira/browse/COUCHDB-1017

On Sun, Jan 9, 2011 at 3:01 PM, Filipe David Manana <fdmanana@apache.org>wrote:

> You should bring this into the development mailing list and/or fill a
> Jira ticket.
>
> regards,
>
> On Sun, Jan 9, 2011 at 1:53 PM, Caolan McMahon <caolan.mcmahon@gmail.com>
> wrote:
> > Hi,
> >
> >> I have this rewrite:
> >> {
> >> "from": "/u/:key",
> >> "to": "_list/pouch/user-items",
> >> "method": "GET",
> >> "query": {"key": ":key"}
> >> }
> >>
> >> ..which gives me: {"error":"bad_request","reason":"invalid UTF-8 JSON"}
> >>
> >> Nothing wrong with the JSON, however, the rewrite handler rewrites to
> this
> >> url: example.com/db/_design/app/_list/pouch/user-items?key=somekey
> >>
> >> somekey needs to be in double quotes as it is a string. How can I get
> the
> >> rewrite handler to produce ?key="somekey" ?
> >
> >
> > I agree, this is really annoying! The way I've been working around it
> > is to use a complex key for the view instead. You can rewrite using
> > {startkey: [':key'], endkey: [':key',{}]} ...and that seems to work
> > fine.
> >
> > Hope that helps for now. Hopefully this behaviour will be changed at some
> point.
> >
> > Caolan
> >
>
>
>
> --
> Filipe David Manana,
> fdmanana@gmail.com, fdmanana@apache.org
>
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message