From dev-return-16371-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Mon May 30 22:04:33 2011 Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69793654D for ; Mon, 30 May 2011 22:04:33 +0000 (UTC) Received: (qmail 13038 invoked by uid 500); 30 May 2011 22:04:31 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 12970 invoked by uid 500); 30 May 2011 22:04:31 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 12803 invoked by uid 99); 30 May 2011 22:04:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 22:04:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2011 22:04:28 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CECE7EA8DF for ; Mon, 30 May 2011 22:03:47 +0000 (UTC) Date: Mon, 30 May 2011 22:03:47 +0000 (UTC) From: "Markus Barchfeld (JIRA)" To: dev@couchdb.apache.org Message-ID: <1207007372.54439.1306793027843.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <19526445.239471294583805644.JavaMail.jira@thor> Subject: [jira] [Commented] (COUCHDB-1017) HTTP Rewrite Handler: Rewriting strings in queries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041309#comment-13041309 ] Markus Barchfeld commented on COUCHDB-1017: ------------------------------------------- Thanks for looking into it. However, I have quite the reverse case: calling a view with a hierarchical key does not work with quotes. For example startkey=[2008,08] works fine but startkey="[2008,08]" does not work at all. Is there a way how I could avoid setting the quotes? Or just any workaround how I could rewrite the above example from "myview/2008/08"? Thanks > HTTP Rewrite Handler: Rewriting strings in queries > -------------------------------------------------- > > Key: COUCHDB-1017 > URL: https://issues.apache.org/jira/browse/COUCHDB-1017 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface > Affects Versions: 1.0.1 > Reporter: Michel Legnered > Assignee: Benoit Chesneau > Priority: Minor > > I have this rewrite: > { > "from": "/u/:key", > "to": "_list/pouch/user-items", > "method": "GET", > "query": {"key": ":key"} > } > ..where the view returns: {"error":"bad_request","reason":"invalid UTF-8 JSON"}. The view query looks like this ?key=somekey, but for the view to succeed "somekey" need to be in double quotes. > Maybe one could improve the rewriter's behavior for rewriting strings in queries? > Here is one workaround: > { > "from": "/u/:startkey", > "to": "_list/pouch/user-items", > "method": "GET", > "query": { > "startkey": [":startkey"], > "endkey": [":startkey", {}] > } > }, -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira