Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 92979 invoked from network); 9 Jan 2011 14:01:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jan 2011 14:01:38 -0000 Received: (qmail 97869 invoked by uid 500); 9 Jan 2011 14:01:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97709 invoked by uid 500); 9 Jan 2011 14:01:35 -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 97701 invoked by uid 99); 9 Jan 2011 14:01:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jan 2011 14:01:35 +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 (athena.apache.org: domain of fdmanana@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Jan 2011 14:01:29 +0000 Received: by fxm5 with SMTP id 5so17438277fxm.11 for ; Sun, 09 Jan 2011 06:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=vQb7Z7EZnEkkeazlTM0LO+0ObFZBOdRlEHvXEYXiM/c=; b=tbohpjsknaWLt9PUVOsOE5Fwg3BpjvC+wFLef124fvCGnUOrW+80WHRDQDP2gc4RN9 i2wZPTMN5bjjdNW7FJPHhqX9prKiKo6TbLsLq1fiSVt79dmdz5xsFk3+XMK21awzF+U9 RMAUWBtwDw2x9p/Bo5BZ1mOojYQv6Ipw3mdYU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=YhbCQ1SqKjKhBzaj11h8e13BNnL2e580jT3zBDqSW1RQj3zFtsd02pKLjSoNEmi+cy 9M342iTSpSS/X8veu4SE++cLHuJgDuvG0HypD93csOHIgq+d3SDwr2415i7loAQfFRdR y7R1cUb3OIKIEl871MlJTYl7lzzz4ZPOERtdM= MIME-Version: 1.0 Received: by 10.223.107.82 with SMTP id a18mr5583939fap.88.1294581666403; Sun, 09 Jan 2011 06:01:06 -0800 (PST) Sender: fdmanana@gmail.com Received: by 10.223.151.12 with HTTP; Sun, 9 Jan 2011 06:01:06 -0800 (PST) In-Reply-To: References: Date: Sun, 9 Jan 2011 14:01:06 +0000 X-Google-Sender-Auth: SWgkDH4hXjKj9KutXchmb_WBIuM Message-ID: Subject: Re: HTTP Rewrite Handler: Strings in queries From: Filipe David Manana To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You should bring this into the development mailing list and/or fill a Jira ticket. regards, On Sun, Jan 9, 2011 at 1:53 PM, Caolan McMahon w= rote: > 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 th= is >> url: example.com/db/_design/app/_list/pouch/user-items?key=3Dsomekey >> >> somekey needs to be in double quotes as it is a string. How can I get th= e >> rewrite handler to produce ?key=3D"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 > --=20 Filipe David Manana, fdmanana@gmail.com, fdmanana@apache.org "Reasonable men adapt themselves to the world. =C2=A0Unreasonable men adapt the world to themselves. =C2=A0That's why all progress depends on unreasonable men."