Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 44938 invoked from network); 2 Sep 2009 17:27:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Sep 2009 17:27:18 -0000 Received: (qmail 63738 invoked by uid 500); 2 Sep 2009 17:27:17 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 63673 invoked by uid 500); 2 Sep 2009 17:27:17 -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 63660 invoked by uid 99); 2 Sep 2009 17:27:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Sep 2009 17:27:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of simonmetson@googlemail.com designates 209.85.218.211 as permitted sender) Received: from [209.85.218.211] (HELO mail-bw0-f211.google.com) (209.85.218.211) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Sep 2009 17:27:06 +0000 Received: by bwz7 with SMTP id 7so1058832bwz.11 for ; Wed, 02 Sep 2009 10:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=+3ni6Zpr9AT2uRUH18GDYnPrTA5MxKdB0DT4Ae2AdiM=; b=gmTRQbgOZPgBDS68ptH448eUWjwf2b5cnv/62ctdlCAFEMfr0eehJE2yZijO19NzXp WhGTEgNDh8ZOU3mraME0qYJ5POGIXfn/bfD4BbgdmLjHkkI+fuUq4gERJm5f+7MVcv0q qf64PPmxQGkPh8c49lsj+mLmYWMJ5PDUy8zwQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=tYdoOie/dAyhlOQPgz5Qq7ZCK0eJQcHPGyQ08U7TxMyTRE9FhPEYhm1TepMn8ApgDB yaA1UDL72hY0xTg1ckLjMZF7wlWMdqeUibyd25K2oebD7p8qFKP3xOY/AfgWE6vWUCk5 NvRYqM45+Lfx46J9s2CRUmFbJ0Iccw5aitMJI= Received: by 10.204.32.206 with SMTP id e14mr6924789bkd.22.1251912405973; Wed, 02 Sep 2009 10:26:45 -0700 (PDT) Received: from macbookpro.lan (93-97-111-13.zone5.bethere.co.uk [93.97.111.13]) by mx.google.com with ESMTPS id 2sm272802fks.3.2009.09.02.10.26.44 (version=SSLv3 cipher=RC4-MD5); Wed, 02 Sep 2009 10:26:45 -0700 (PDT) Message-Id: From: Simon Metson To: user@couchdb.apache.org In-Reply-To: <51d0803c0909021012q5f8c1f6eu95be9cdd6e87deed@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: View to find someone in a list in a document Date: Wed, 2 Sep 2009 18:26:42 +0100 References: <51d0803c0909020925s75bdc063gd108f8c5618ca38c@mail.gmail.com> <9BE6119F-6D55-4293-B209-9D23F7A33484@googlemail.com> <51d0803c0909021012q5f8c1f6eu95be9cdd6e87deed@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org Ok, so use that map function and query it as: http://localhost:5984/test/_design/users/_view/user?key= That will give you back all the documents that have in the users list. Cheers Simon On 2 Sep 2009, at 18:12, Jehan Bihin wrote: > Hi Simon, > > Thanks for your help. > > I need the document if the key is present in the list. > > Thanks, > > Jehan > > > 2009/9/2 Simon Metson > >> Hi, >> Do you mean you want to emit each user as a key? Something >> like: >> >> function(doc) { for (v in doc.users) { emit(doc.users[v], doc); } >> >> as a map would do that. >> Cheers >> Simon >> >> >> On 2 Sep 2009, at 17:25, Jehan Bihin wrote: >> >> Hi all, >>> >>> (sorry for my english) >>> I have a document having a list of persons : >>> >>> ... >>> "users":{"membre-joouul_hotmail.com":["createur"],"membre- >>> killan_daaboo.net >>> ":["moderateur"]} >>> ... >>> >>> Each persons have some roles. >>> My key is the membre like 'membre-joouul_hotmail.com' >>> And i want to list all document having my key present in the users >>> list. >>> >>> Is it possible and correct to have it ? >>> Can you guide me ? After reading here and the site I found nothing >>> talking >>> on that. >>> >>> Thanks in advance, >>> >>> Jehan >>> >> >>