Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 91735 invoked from network); 9 Jan 2011 13:54:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jan 2011 13:54:21 -0000 Received: (qmail 92970 invoked by uid 500); 9 Jan 2011 13:54:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 92712 invoked by uid 500); 9 Jan 2011 13:54:19 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 92704 invoked by uid 99); 9 Jan 2011 13:54:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jan 2011 13:54:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of caolan.mcmahon@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jan 2011 13:54:11 +0000 Received: by eyf18 with SMTP id 18so7743134eyf.11 for ; Sun, 09 Jan 2011 05:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=gnerWBTOUtLahEpKtF2I5xTxMCoRvciruK2FuaGqRy8=; b=r661oqLqIRDqFMh3rMOChvp0KLJgfDQrNP5+ce7CSWxsZqugP/e3Nn2WJt4Urbb98V kviuyrCEeFv/kB8oLjXvUVjAyxPDSkiZ3zJYn6FoyFdOieMQgRgsxkXPMTqVpSv4egJz bPPj9E5bD/2yuZ3vQsGb3PBy94/qus0wD0eig= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZWcxnPz9XSIqjLDdEgXuETEW6QZka6jyXO0wPztqMEhcQJSKgIwzmIrkS80XsVQCH/ Hal7jrT3xeZDttkvHgZpeR3b1VFNtUd0+x9o1r5KK2AptoDf0TlT7FeIpr5kuZQFrzfk PdIShup3DZsPKxWPXNYQlrKQjoa6GCQn+96Pk= MIME-Version: 1.0 Received: by 10.213.15.212 with SMTP id l20mr1058337eba.32.1294581230297; Sun, 09 Jan 2011 05:53:50 -0800 (PST) Received: by 10.213.34.19 with HTTP; Sun, 9 Jan 2011 05:53:50 -0800 (PST) In-Reply-To: References: Date: Sun, 9 Jan 2011 13:53:50 +0000 Message-ID: Subject: Re: HTTP Rewrite Handler: Strings in queries From: Caolan McMahon To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi, > I have this rewrite: > { > "from": "/u/:key", > "to": "_list/pouch/user-items", > "method": "GET", > "query": {"key": ":key"} > } > > ..which gives me: {"error":"bad_request","reason":"invalid UTF-8 JSON"} > > Nothing wrong with the JSON, however, the rewrite handler rewrites to this > url: example.com/db/_design/app/_list/pouch/user-items?key=somekey > > somekey needs to be in double quotes as it is a string. How can I get the > rewrite handler to produce ?key="somekey" ? I agree, this is really annoying! The way I've been working around it is to use a complex key for the view instead. You can rewrite using {startkey: [':key'], endkey: [':key',{}]} ...and that seems to work fine. Hope that helps for now. Hopefully this behaviour will be changed at some point. Caolan