You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Weixiang Guan (JIRA)" <ji...@apache.org> on 2014/07/29 11:11:38 UTC

[jira] [Created] (COUCHDB-2286) Query with variables in design document

Weixiang Guan created COUCHDB-2286:
--------------------------------------

             Summary: Query with variables in design document
                 Key: COUCHDB-2286
                 URL: https://issues.apache.org/jira/browse/COUCHDB-2286
             Project: CouchDB
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: JavaScript View Server
            Reporter: Weixiang Guan


I have the following rewrite definition in my design document:
{code:javascript}{
			"from": "actors_in_film/:film_id",
			"to": "_list/simple_list/film_actor",
			"query": {
				"include_docs": "true",
				"key":[":film_id",0]
			}
		}{code}
This works. However when I checked out the log, I found the URL was rewritten to *include_docs=true&key=%5B%22film_2%22%2C0%5D&film_id=film_2*, where the parameter *film_id=film_2* does not make any sense! Although this non-sense parameter does nothing to the query, but I would say it is still a bug.

If it is possible also to mention another thing, I would suggest, boolean and numeric values in the query fields (e.g. *"limit":"10"* and *"include_docs":"true"*) should be able to be specified without double quotes, because it is inconsistent with array (e.g. *"key":["film_2",0]*, where one does not need to put the whole array in double quotes).



--
This message was sent by Atlassian JIRA
(v6.2#6252)