From user-return-16646-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Jun 10 09:41:33 2011 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 898C64255 for ; Fri, 10 Jun 2011 09:41:33 +0000 (UTC) Received: (qmail 72385 invoked by uid 500); 10 Jun 2011 09:41:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 72354 invoked by uid 500); 10 Jun 2011 09:41:31 -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 72346 invoked by uid 99); 10 Jun 2011 09:41:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 09:41:31 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of daniele.testa@gmail.com designates 209.85.216.52 as permitted sender) Received: from [209.85.216.52] (HELO mail-qw0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2011 09:41:24 +0000 Received: by qwb8 with SMTP id 8so1548704qwb.11 for ; Fri, 10 Jun 2011 02:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=2Z42fD+G0zADX0EP7DYPK0ARv/RT4m1vraNsSh7sHB0=; b=fdt+QUb4Am37ielK9xcWi1bQaQYpcYsWLeaJVi9Nc+PIfSopY193qOwhpjZo52wzFY V4dSc0V2szwz/bWSOHnpBffbyjpT5vD7udZH1frFWZ7b+NWwSp8m3WIdKUGhL8PJ/4Se 6eTGi2YfQwAe/Tw9c7NetUzYJ+ElE7C1nMKA4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bw99IXHt9/pvnmbCOy8nSnfLXc+OKJfhNENu7+nihrwjnyVu0F6iIsll6MpX2Dlc/O SF6Tmks1f+7DcFpByEkRlNJ5GDhXIWN14lit/UCfqzELHRJnMDyr/TzZg4Fa29GpzT/z g9zYtb4landFYu8r0+1GGExROTtil8nzgdFVo= MIME-Version: 1.0 Received: by 10.229.77.195 with SMTP id h3mr1377840qck.237.1307698863416; Fri, 10 Jun 2011 02:41:03 -0700 (PDT) Received: by 10.229.239.197 with HTTP; Fri, 10 Jun 2011 02:41:03 -0700 (PDT) Date: Fri, 10 Jun 2011 11:41:03 +0200 Message-ID: Subject: One view per "query"? From: Daniele Testa To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I just want to check with you guys that I understand things correctly. Lets say I have a database that stores music songs. Each song has a "title", "insert_date", "album", "genre". Now, if I want to do these "queries": "All songs that belongs to album=X ordered by title" "All songs that belongs to genre=X ordered by insert_date descending" "All songs that belongs to genre=X ordered by title" "All songs ordered by insert_date descending" Etc.. Is it true that I will have to create an unique view for each of these cases? I assume I cannot do something like emit( [doc.album, doc.genre, doc.insert_date, doc.title], doc); And then just choose what index in that array I want to use? It is ordered left-to-right, right? That would mean that I cannot do something like startkey=[null, null, 0, null]&endkey=[null, null, {}, null] .. to get all songs ordered by "insert_date"? Regards, Daniele