Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 78804 invoked from network); 20 Nov 2009 11:48:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Nov 2009 11:48:16 -0000 Received: (qmail 19488 invoked by uid 500); 20 Nov 2009 11:48:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19441 invoked by uid 500); 20 Nov 2009 11:48:14 -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 19431 invoked by uid 99); 20 Nov 2009 11:48:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Nov 2009 11:48:14 +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: domain of sebastien.pastor@gmx.com designates 213.165.64.42 as permitted sender) Received: from [213.165.64.42] (HELO mailout-eu.gmx.com) (213.165.64.42) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 20 Nov 2009 11:48:06 +0000 Received: (qmail invoked by alias); 20 Nov 2009 11:47:45 -0000 Received: from nor75-28-88-183-28-27.fbx.proxad.net (EHLO seblaptop) [88.183.28.27] by mail.gmx.com (mp-eu004) with SMTP; 20 Nov 2009 12:47:45 +0100 X-Authenticated: #57395542 X-Provags-ID: V01U2FsdGVkX1/cKOgl9DfcZFam+8BjxuRmZKplVgAetd4uR7t9hp kFv0SLo+WGEVgs Date: Fri, 20 Nov 2009 13:43:43 +0100 From: Sebastien PASTOR To: user@couchdb.apache.org Subject: Re: Newbie :Filtering using complex key and array Message-ID: <20091120124342.GA6038@seblaptop> References: <20091120112631.49640@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091120112631.49640@gmx.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.61 X-Virus-Checked: Checked by ClamAV on apache.org Sorry for the previous blank mail ... here is the content : Hi there, Pretty new to couchDB. I ve read a lot about couchdb and finally dive into it with a small project :) I am trying to do a simple thing and i am not sure at all if i am going the right way : my docs look like this : { "name":"Pizza Torino", "delivery_areas":[75019,75018,75012,75013,75010], "type":"italian" } I managed to get all shops by type and get a reduce function to do the sum ( not much i know but still quite an accomplishment for me :) ) I then tried to get my result filtered by delivery_areas. as in getting only shop that do delivery in postal code 75019. I just could not have anything that worked using startkey and endkey ... is it the way to go or is storing delivery_areas within an array not right ? my last map function looks like this : "getShops" : { "map" : "function(doc){ emit([doc.delivery_areas,doc.type],doc.name) } } Thanks for pointing me to the right direction Cheers Seb