Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 1919 invoked from network); 12 Feb 2009 10:42:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2009 10:42:57 -0000 Received: (qmail 43213 invoked by uid 500); 12 Feb 2009 10:42:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 42595 invoked by uid 500); 12 Feb 2009 10:42:54 -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 42584 invoked by uid 99); 12 Feb 2009 10:42:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 02:42:54 -0800 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 clairon@gmail.com designates 209.85.218.163 as permitted sender) Received: from [209.85.218.163] (HELO mail-bw0-f163.google.com) (209.85.218.163) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 10:42:46 +0000 Received: by bwz7 with SMTP id 7so960544bwz.11 for ; Thu, 12 Feb 2009 02:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=MH6ePxdgBiyG1Mb8LlEsdusUz66FSDyJ08s6dMGOLjI=; b=a1aF6MZjYTEAVaOHBFttPGUBQtm9o7AOQPywiE35gaDNqGQCx93l5vS5Z8E0bTIWPa Fd1lihqfqobIIfiw0L5Oh134Ltqn245silRkaE3tF7DLlvHtZ8n/fwOFSYki2VqOiWIb HYXQW4EXcwZFw+AScpBUrkWd9Bo3CUEZ1CM48= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=bW+uvPGyDYZh1j15Gx7N7eVbMV1QpWgm2/noUm/TsIk3gEEF48BtDcZUyCDsS367jM Vy3XSysxdvytG95tB9BmoHFyqFV7Q2WSpyLfhhp4K0zRHjjJbvMGeRQu9Y+Q6zh03l/g tbIJmr47DlYnlYuI43WjgOEPDuCV+1tCf3pP8= MIME-Version: 1.0 Received: by 10.103.228.19 with SMTP id f19mr75229mur.18.1234435345469; Thu, 12 Feb 2009 02:42:25 -0800 (PST) Date: Thu, 12 Feb 2009 11:42:25 +0100 Message-ID: <4b307fd10902120242v3bbbc93fs92c88503eb632fe9@mail.gmail.com> Subject: playing with tags From: Nicolas Clairon To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi there ! I'm playing with tags these time and a question comes to me. For exemple, I have a bunch of blog articles: article1 = { ...snip..., tags : ["couchdb", "python", "best practices"], } article2 = { ...snip..., tags : ["python", "best practices"], } article3 = { ...snip..., tags : ["couchdb", "best practices"], } and a view wich emit tags: function(doc){ if (doc.type=="article"){ for (var i in doc.tags){ emit( doc.tags[i], doc ) } } } We can get all articles wich are tagged with "couchdb" easily: http://localhost:5984/blog/_view/article/by_tag?key="couchdb" but now, I want all articles wich are tagged with "couchdb" *and* "python" (I want the article1). Is there a method to do it directly with CouchDB views ? Something like that : http://localhost:5984/blog/_view/article/by_tag?key_in=["couchdb", "python"] For the moment, I have to do it by program, firing 2 views and merge the results... We can also think something like this: http://localhost:5984/blog/_view/article/by_tag?onekey_in=["couchdb", "python"] wich will get all articles which are tagged with "couchdb" *or* "python"... Does it already exists in CouchDB ?