Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 37610 invoked from network); 9 Jun 2010 15:33:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jun 2010 15:33:15 -0000 Received: (qmail 38834 invoked by uid 500); 9 Jun 2010 15:33:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 38785 invoked by uid 500); 9 Jun 2010 15:33:13 -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 38777 invoked by uid 99); 9 Jun 2010 15:33:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 15:33:13 +0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=AWL,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of 7zark7@gmail.com designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pw0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 15:33:07 +0000 Received: by pwi10 with SMTP id 10so3880593pwi.11 for ; Wed, 09 Jun 2010 08:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=8B740E3R7BFcQte/PPSuWJP1V2qmgVDHG5Yope4WjrA=; b=q4uDPh747U+BO6JKHtYwH3Afw+GjbJulea2uCkU3KpjOWX8xgMqnw2Avwx0q2g3EIU /KqPYeC4bWzS+yZy7BK2LsQYWC36BVOODaU9dnYqHKN2w/7GG9Qwkyre8Qi69igAPB/3 X3t7P3LCGzAtceekKkLzShdMxajLaGkIPSfUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=dqsONyjEhyKfNc1M2JyKd8YVGHh9+xrUwomBa8qJAUwM9nHtjmuSAu0DsyTQcevXke bnhEappax8bVz27KERAcGEJi1ObYEiAU7is1ZDyf5eNvcLmft4ttHpFBc27ngKMtK0BW 6cUYBpzYTXqCHQmvI2+RGgClCMdF236rf9aJU= MIME-Version: 1.0 Received: by 10.229.248.2 with SMTP id me2mr6993341qcb.44.1276097562722; Wed, 09 Jun 2010 08:32:42 -0700 (PDT) Received: by 10.220.177.5 with HTTP; Wed, 9 Jun 2010 08:32:42 -0700 (PDT) Date: Wed, 9 Jun 2010 08:32:42 -0700 Message-ID: Subject: Rewrite + List + View problem From: Anh <7zark7@gmail.com> To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm trying to use the rewrite handler to clean up a list function URL, but doesn't seem to work correctly. The view and list function work fine without the rewrite. The view and reduce output complex keys like so: {"rows":[ {"key":[123456,"Alpha],"value":2}, {"key":[985323,"Bravo"],"value":1}, ]} and the view and list URL work correctly using these parameters: http://couch:5984/db/_design/temp/_list/list/view?group=true&startkey=[123456,%22%22]&endkey=[123456,%22\u9999%22] (Using vhosts) I'm trying to rewrite the ugly URL and parameters to be: /owner/:owner/list (where :owner is a numeric value) The rewrite I wrote looks like this: { "from": "/owner/:owner/list", "to": "_list/list/view", "method": "GET", "query": { "group": true, "startkey": [":owner", ""], "endkey": [":owner", "\\u9999"] } } However, this is getting rewritten to the following: 'GET' /db/_design/temp/_list/list/view?startkey=%5B%22%3Aowner%22%2C%22%22%5D&endkey=%5B%22%3Aowner%22%2C%22%5C%5Cu9999%22%5D&group=true&owner=123456 which does not throw an error, but returns an empty view since the URL-encoded keys do not match anything. Is there some way to do this with CouchDB rewrites? (Passing the startkey and endkey parameters to the "nice" URL would defeat the purpose of this rewrite) Thanks