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 a parameterized URL
Date Sat, 05 Jun 2010 11:09:31 GMT
On Sat, Jun 5, 2010 at 9:16 AM, Aurélien Bénel <aurelien.benel@utt.fr> wrote:
> Hi there,
>
> I am now trying to rewrite URLs...
>
> With a nightly build of CouchDB (to fix COUCHDB-677 issue), I successfully used this
rewrite rule:
> [
>  {
>   "from": "/item/:corpus",
>   "to": "_list/mapping/kwic",
>   "query": {
>     "startkey": [":corpus"],
>     "endkey": [":corpus",{}]
>   }
>  }
> ]
>
> However in order to implement the given specification, I would need something like this
rule:
> [
>  {
>   "from": "/item/?corpus=:corpus",
>   "to": "_list/mapping/kwic",
>   "query": {
>     "startkey": [":corpus"],
>     "endkey": [":corpus",{}]
>   }
>  }
> ]
Oh what you would like is :

[
 {
  "from": "/item",
  "to": "_list/mapping/kwic",
  "query": {
    "startkey": [":corpus"],
    "endkey": [":corpus",{}]
  }
 }
]

and just pass corpus=corpus as argument in your client url : /item?corpus= ...

Mime
View raw message