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 7BC7943D3 for ; Tue, 21 Jun 2011 13:34:09 +0000 (UTC) Received: (qmail 1573 invoked by uid 500); 21 Jun 2011 13:34:09 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 1536 invoked by uid 500); 21 Jun 2011 13:34:08 -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 1527 invoked by uid 99); 21 Jun 2011 13:34:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jun 2011 13:34:08 +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; Tue, 21 Jun 2011 13:34:07 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C2D70426EFC for ; Tue, 21 Jun 2011 13:33:47 +0000 (UTC) Date: Tue, 21 Jun 2011 13:33:47 +0000 (UTC) From: "Gabriel Farrell (JIRA)" To: dev@couchdb.apache.org Message-ID: <679328956.24377.1308663227794.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 [ https://issues.apache.org/jira/browse/COUCHDB-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13052560#comment-13052560 ] Gabriel Farrell commented on COUCHDB-1017: ------------------------------------------ Benoit, works for me. Which commit fixed this? It would be nice to have a pointer. Markus, have you tried this in your rewrites: "startkey": [":year", ":month"]. > 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