incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mart...@gmail.com
Subject Re: Rewriting query keys
Date Wed, 27 Nov 2013 22:52:51 GMT
Here's an example of one I use that does something similar

[


    { 
        "from" : "/isBlocked/:blockee", 
        "to": "_list/isBlocked/isBlocked", 
        "query": { 
            "key" : ":blockee", 
            "include_docs" : "true",
            "reduce" : "false"
        } 
    },
    ...
]


Martin

On Wed, Nov 27, 2013 at 10:01 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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message