couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <robert.new...@gmail.com>
Subject Re: URL rewriter - bind variables and complex keys
Date Mon, 15 Mar 2010 23:17:37 GMT
This also scratches an itch for me, happy to help out.

On Mon, Mar 15, 2010 at 10:50 PM, Zachary Zolton
<zachary.zolton@gmail.com> wrote:
> Thanks, Benoit! I plan on using this feature heavily... (^_^)
>
> I created the JIRA issue:
> https://issues.apache.org/jira/browse/COUCHDB-699
>
> On Mon, Mar 15, 2010 at 5:24 PM, Benoit Chesneau <bchesneau@gmail.com> wrote:
>> On Mon, Mar 15, 2010 at 9:55 PM, Zachary Zolton
>> <zachary.zolton@gmail.com> wrote:
>>> Howdy,
>>>
>>> I have the following rewrite rule:
>>>
>>>  {
>>>    "from": "/events/:year",
>>>    "to": "_list/event-list/events-by-date",
>>>    "method": "GET",
>>>    "query": {
>>>      "startkey": [":year"],
>>>      "endkey": [":year", {}]
>>>    }
>>>  },
>>>
>>> Now, I'll try to hit this URL for a specific year:
>>>
>>> $ curl http://localhost:6666/db/_design/ddoc/_rewrite/events/1975
>>>
>>> Unfortunately, I didn't get the expected data. (;_;)
>>>
>>> Here's the log entry:
>>>
>>> [info] [<0.1522.0>] 127.0.0.1 - - 'GET'
>>> /db/_design/ddoc/_list/event-list/events-by-date?startkey=%5B%22%3Ayear%22%5D&endkey=%5B%22%3Ayear%22%2C%7B%7D%5D&year=1975
>>> 200
>>>
>>> Noticing that the start and end keys both contain %3Ayear, I'm
>>> guessing that it just URL encoded the string ":year". So, I'm guessing
>>> the rewriter module isn't looking for bind variables in key parameters
>>> when the value is a list.
>>
>> This behaviour isn't expected yet. I will commit a patch that allos
>> this this week.
>>>
>>> Shall I open up a ticket in JIRA?
>>>
>>>
>> Sure it's better for tracking anyway.
>>
>> - benoit
>>
>

Mime
View raw message