Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 45943 invoked from network); 30 Oct 2010 17:41:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Oct 2010 17:41:26 -0000 Received: (qmail 97715 invoked by uid 500); 30 Oct 2010 17:41:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97649 invoked by uid 500); 30 Oct 2010 17:41:24 -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 97641 invoked by uid 99); 30 Oct 2010 17:41:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Oct 2010 17:41:24 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zengeneral@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Oct 2010 17:41:19 +0000 Received: by vws15 with SMTP id 15so1542369vws.11 for ; Sat, 30 Oct 2010 10:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=77KHBOl36xqT/rzNO66rgCR8Gv7AF+8Y9nISzDgqIEI=; b=ZltWl+D1Nh4w4L5QmoqvwDj79fodjSeZvLVQmzHAPaaDGnPhm8y9nVEVALAyOgj0fg tIpR+DTKt8S8sgMGCQyz0EXW99g0QsLbM18Ap3GTKe1Ue64Jo78qnU7plkw6/PNm3AHY aXS8PLpvgFDfsKU4Ae+jn+ek2Oxf05uhpOB2E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=sOvIHvQFCjrsqkpM/kflzv6vlYBt2wJB17lhuEaKuXzigQziB+jCXNp9d9USx5IKmT 06DrMcOCTSWTvNB9i3soMDNILdUWsvVwV9ZFjUKlZAVJamWDw19fznF/V2Fv1QzS6qd0 BKwDU+O2U1+3nDy1M5Xg6drPhyiVeNAaZ1oA0= MIME-Version: 1.0 Received: by 10.224.185.211 with SMTP id cp19mr6954606qab.323.1288460459168; Sat, 30 Oct 2010 10:40:59 -0700 (PDT) Received: by 10.229.85.66 with HTTP; Sat, 30 Oct 2010 10:40:58 -0700 (PDT) Date: Sat, 30 Oct 2010 12:40:58 -0500 Message-ID: Subject: sharing an idea From: "Jeffrey M. Barber" To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf30334fbdf9d2d70493d91330 --20cf30334fbdf9d2d70493d91330 Content-Type: text/plain; charset=ISO-8859-1 I'm building with node.js and CouchDB, and I think the pair are a perfect marriage. I wanted to share something that I discovered the other day. I'm building a simplified data layer in my node.js+CouchDB application framework WIN ( github.com/mathgladiator/win ) and I was thinking that making applications portable with design documents was kind of a pain to install without some kind of framework support. I'm assuming the application is going to operate in a single database, and I'm going to a have a bunch of indices/views-maps work within a single design document. Since node.js is JavaScript and functions in v8 have a toString method, I can merge code from application logic to the design document. Here is the WIN code to build an index of users. $.indexer("users_by_user_id",function(doc) { if(doc.ns=="user") emit(doc.id,doc); }); I can work in the same document and deploy without worrying about what design documents already exist. --20cf30334fbdf9d2d70493d91330--