From user-return-26304-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Nov 27 22:02:00 2013 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2AB2E108AA for ; Wed, 27 Nov 2013 22:02:00 +0000 (UTC) Received: (qmail 16455 invoked by uid 500); 27 Nov 2013 22:01:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 16416 invoked by uid 500); 27 Nov 2013 22:01:57 -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 16408 invoked by uid 99); 27 Nov 2013 22:01:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2013 22:01:57 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [62.113.250.122] (HELO mail.orlives.de) (62.113.250.122) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2013 22:01:51 +0000 Received: from arschbook.localnet (p5DD62ADD.dip0.t-ipconnect.de [93.214.42.221]) by mail.orlives.de (Postfix) with ESMTPSA id C9BAC52E1497 for ; Wed, 27 Nov 2013 23:00:57 +0100 (CET) From: Oliver Schmidt To: user@couchdb.apache.org Subject: Rewriting query keys Date: Wed, 27 Nov 2013 23:02:15 +0100 Message-ID: <15065551.sG713Z5ONP@arschbook> User-Agent: KMail/4.11.3 (Linux/3.12.1-1-ARCH; KDE/4.11.3; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1507602.6alLeb3ugv"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-Virus-Checked: Checked by ClamAV on apache.org --nextPart1507602.6alLeb3ugv Content-Type: multipart/alternative; boundary="nextPart30126309.fb7jPEp3Cq" Content-Transfer-Encoding: 7Bit This is a multi-part message in MIME format. --nextPart30126309.fb7jPEp3Cq Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, I want to show a list of tags in my couchapp. So I created a view "tags" which aggregates the items in my DB in the form key:[tagname_string[0],tagname_string], value=objectname. Now I want to be able to use a list function, which just shows the objects with a certain key supplied in the URL. I created the following rewrite: {from: '/tags/:key', to: '_list/testList/tags'}, which internally queries _list/testList/tags?k=suppliedkey using the view _view/tags?k=suppliedkey . But this is invalid JSON, I need _view/tags?k=["suppliedkey"] . How can I rewrite to a valid JSON key? Thanks, Oliver --nextPart30126309.fb7jPEp3Cq Content-Transfer-Encoding: 7Bit Content-Type: text/html; charset="us-ascii"

Hi,

I want to show a list of tags in my couchapp. So I created a view "tags" which aggregates the items in my DB in the form key:[tagname_string[0],tagname_string], value=objectname.

Now I want to be able to use a list function, which just shows the objects with a certain key supplied in the URL. I created the following rewrite:

{from: '/tags/:key', to: '_list/testList/tags'},

which internally queries _list/testList/tags?k=suppliedkey using the view _view/tags?k=suppliedkey . But this is invalid JSON, I need _view/tags?k=["suppliedkey"] . How can I rewrite to a valid JSON key?

 

Thanks, Oliver

--nextPart30126309.fb7jPEp3Cq-- --nextPart1507602.6alLeb3ugv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJSlmv3AAoJEMTRts8jlTP3NWIP/1BDWIAz2GcJjffVxljBsRJ4 WTPQyvIKREhn35GkqK47FbFzVN8AhOaljaVG6wynkXLzXkESDwprSHaXgE+gCm2x X9zwT6CDX6T2e7ULylXtmm8+UxftaAO3pU/Q19Qh1AkluMKqtCKZpmZ9zqW8m2mH 3MhrcNoQQDpKm0jL/gkOVDnPUuz3CW4HY7T3Lb8JT2/NjQp3LF901/Jt5Ou4oyRr +Vrra8yL4quC2MIDqvaH4tjDdnYiZ/trLyx0gg8rhdBPohOkUEjMwcrKTw6MCQvh mBIvEJp2CrzM8D2ZWnhBtUJtmkABkq3foIrPz5P0X3JSW6h1+dRYi88KY8Y7qNo3 RjhdfJ1NQA0BgArybr5FROjF+cV0tZmwZT2z95PCRWkc/y/d6stt/iFGu9fx89lL B+0ORMrlY/nDuRGnh1vQCgrqnKnIJtutQuhFRR7M3gYUbny5FfJCPI2kBbGhkyh0 5dE97ALLSYOFUvlDgwEqWlLsa/Elq10gi4uh/q4gjoWRCZ+Yp8OqcFvz5jLdgAOk UECW/g4JPMakIYA10qorRTHuuDhy2qY3P32owqlpUmKvZ3NFV/gVYPcA2h0WLKws WyNPI7VbU+8HIxEplx/2uzjfidT/dJp9nKy1vsE8y6kykLtRB37nWLiPXJP7u+Kq fvLq0JwrXoAsWBfF2NRw =3dAv -----END PGP SIGNATURE----- --nextPart1507602.6alLeb3ugv--