couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject URL rewriter - bind variables and complex keys
Date Mon, 15 Mar 2010 20:55:30 GMT
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.

Shall I open up a ticket in JIRA?


Cheers,

Zach

P.S. I'm running version 0.11.0b7929118-git, from a clean checkout of
the 0.11.x branch from Github.

Mime
View raw message