From user-return-3475-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Feb 11 18:23:23 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 87125 invoked from network); 11 Feb 2009 18:23:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 18:23:23 -0000 Received: (qmail 62737 invoked by uid 500); 11 Feb 2009 18:23:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 62303 invoked by uid 500); 11 Feb 2009 18:23:20 -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 62292 invoked by uid 99); 11 Feb 2009 18:23:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 10:23:20 -0800 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 kowsik@gmail.com designates 74.125.92.27 as permitted sender) Received: from [74.125.92.27] (HELO qw-out-2122.google.com) (74.125.92.27) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 18:23:12 +0000 Received: by qw-out-2122.google.com with SMTP id 5so81378qwi.29 for ; Wed, 11 Feb 2009 10:22:51 -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=M55ZgQTN749W98BbU9a+iVQw9JyJ0pDkSI8XQdaOTNw=; b=jMFSd5YSIja5FCxxppGGnaXYircWmBA4T5LzAZj/IjyIdZTaBv+OOMFe7wJ1EAQdyj 1BeWehO9f8Y76F6DNK74W0fFtb3dm2w7uSQAuuPonoVVGMoe0K974fwB2fLI3BF2nf/z Bqj781vYPbR9on1f7n0BsvsjOuB4HTqXOBVKk= 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=OObUBjxLT81Tm3KLtibiq0Dscwikdbkeq0MfDeKh3zGMMELUTAe6h6W548tAPc7Nww VfBcgZRU9OUnYoICUttvF3Ex08Ca5/pFyGqKgjk6iQgXKPqELZwlcPWnnx+5eUtJYVYW cPqRStOa/qSqt5qDw5sZJHSCKsjXWUMi3/MTM= MIME-Version: 1.0 Received: by 10.224.37.17 with SMTP id v17mr883316qad.134.1234376571742; Wed, 11 Feb 2009 10:22:51 -0800 (PST) Date: Wed, 11 Feb 2009 10:22:51 -0800 Message-ID: <7db9abd30902111022i6c7f6385n23beba458565afb@mail.gmail.com> Subject: Thoughts on document/views... From: kowsik To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Just something that occurred to me and wanted to run it by you guys. For pcapr, I have a number of different types of documents in couch-db, some are comments, some are about the packets, etc. Now, I have views that do something like this: map: function(doc) { if (doc.type == 'comment') emit(...); } With a large set of documents and a large set of views, any new document or updates to document is passed to __all__ of the views (when the view is eventually invoked). But I "know" that my documents come in classes and that only certain views really apply to them. I'm thinking of a view as a static method on a class that gets some information about the instances. What I'm getting at is, does it make sense to have some type of document "class" attribute and then have views bound to these classes? The goal, of course, being that couch-db can pre-filter a lot of these things and only run the views for the appropriate types of documents. Thoughts? K.