Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 93327 invoked from network); 24 Mar 2010 09:22:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Mar 2010 09:22:21 -0000 Received: (qmail 84010 invoked by uid 500); 24 Mar 2010 09:22:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 83622 invoked by uid 500); 24 Mar 2010 09:22: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 83614 invoked by uid 99); 24 Mar 2010 09:22:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Mar 2010 09:22:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [143.126.211.20] (HELO lares.culture.fr) (143.126.211.20) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Mar 2010 09:22:10 +0000 Received: from hermes.culture.fr (hermes.culture.fr [143.126.201.210]) by lares.culture.fr (Postfix) with ESMTP id AE052341C7 for ; Wed, 24 Mar 2010 10:21:47 +0100 (CET) Received: by mta.culture.fr with id o2O8QZxL027026 for ; Wed, 24 Mar 2010 09:26:59 +0100 Received: from [143.126.157.10] (heckel.culture.fr) by pasteur2.culture.fr (!) with ESMTP id for ; Wed, 24 Mar 2010 09:26:37 +0100 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: Help With View Query From: =?iso-8859-1?Q?COING_G=E9rard?= In-Reply-To: Date: Wed, 24 Mar 2010 09:29:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1077) X-Virus-Checked: Checked by ClamAV on apache.org Le 23 mars 2010 =E0 22:51, A.J. Brown a =E9crit : > Hi All, >=20 > I'm having some trouble querying a view. Can you help me out? I'm > trying to query a view of comments for a specific topic. My view has > the topic document id and a ISO date string as the key. >=20 > I've tried many combinations of the following, but no matter what I > always get the entire list of comments back. There are 3 comments in > the database that should match (have the correct topic_id) and 6 total > rows. >=20 > = startKey=3D["2e7768c509e896e658ecb75f3c1cf84c",null]&endKey=3D["2e7768c509= e896e658ecb75f3c1cf84c",{}] > = startKey=3D["2e7768c509e896e658ecb75f3c1cf84c"]&endKey=3D["2e7768c509e896e= 658ecb75f3c1cf84c",{}] > = startKey=3D["2e7768c509e896e658ecb75f3c1cf84c",null]&endKey=3D["2e7768c509= e896e658ecb75f3c1cf84c","\u9999"] > = startKey=3D["2e7768c509e896e658ecb75f3c1cf84c",null]&endKey=3D["2e7768c509= e896e658ecb75f3c1cf84c",null, > null] I think your problem is here : "startkey" and "endkey" (all in lower = case) >=20 > Here's the map function for that view: >=20 > function(doc) {if( doc.type =3D=3D 'comment' ) { emit( [doc.topic_id, > doc.created], doc );}} >=20 > And here's an example comment document: >=20 > { > "_id": "1b324c9430cd734bc08ae773c659170c", > "_rev": "1-8526badbb1259f10cd4b938a2e7c3918", > "type": "comment", > "author": "ajbrown", > "topic_id": "2e7768c509e896e658ecb75f3c1cf84c", > "parent_comment_id": "", > "message": "tsetst etettstts", > "created": "2010-03-23T17:32:19-04:00" > } >=20 > In Futon, my keys look right. Example: >=20 > ["2e7768c509e896e658ecb75f3c1cf84c", "2010-03-23T17:32:19-04:00"] >=20 > -- > A.J. Brown > Software Engineer, ZCE > blog : http://ajbrown.org > talk : (937) 540-0099 > chat : IntypicaAJ