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 query keys
Date Fri, 13 Dec 2013 18:12:22 GMT
On Wed, Nov 27, 2013 at 11:02 PM, Oliver Schmidt <
oliver.schmidt+ml@orlives.de> wrote:

>  Hi,
>
> I want to show a list of tags in my couchapp. So I created a view "tags"
> which aggregates the items in my DB in the form
> key:[tagname_string[0],tagname_string], value=objectname.
>
> Now I want to be able to use a list function, which just shows the objects
> with a certain key supplied in the URL. I created the following rewrite:
>
> {from: '/tags/:key', to: '_list/testList/tags'},
>
> which internally queries _list/testList/tags?k=suppliedkey using the view
> _view/tags?k=suppliedkey . But this is invalid JSON, I need
> _view/tags?k=["suppliedkey"] . How can I rewrite to a valid JSON key?
>
>
>
> Thanks, Oliver
>

{"query":{"key": [":key"]}} should work.

- benoit

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