incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taras Puchko <>
Subject Rewrite a URL segment into a parameter with JSON string encoding
Date Tue, 07 Sep 2010 12:56:18 GMT

I'm trying to use a URL segment as a key for a view, like the following:
  "from": "/tags/:tagname",
  "to": "_view/by-tag",
  "query": {"key": ":tagname"}

The problem is that the key have to be JSON-encoded, which complicates my
API. Every client has to know how to JSON-encode strings.

However, I have found a workaround. If I use arrays for my keys the
following works:
  "from": "/tags/:tagname",
  "to": "_view/by-tag",
  "query": {"key": [":tagname"]}

I'm wondering if there is a more efficient solution for this problem.


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