Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 24954 invoked from network); 28 May 2009 21:20:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 May 2009 21:20:38 -0000 Received: (qmail 18831 invoked by uid 500); 28 May 2009 21:20:40 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 18763 invoked by uid 500); 28 May 2009 21:20:40 -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 18753 invoked by uid 99); 28 May 2009 21:20:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 21:20:40 +0000 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 fils@iastate.edu designates 129.186.140.15 as permitted sender) Received: from [129.186.140.15] (HELO mailhub-5.iastate.edu) (129.186.140.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 21:20:28 +0000 Received: from devirus-11.iastate.edu (devirus-11.iastate.edu [129.186.1.48]) by mailhub-5.iastate.edu (8.12.11.20060614/8.12.10) with SMTP id n4SLK6Hg011822 for ; Thu, 28 May 2009 16:20:06 -0500 Received: from (despam-10.iastate.edu [129.186.140.80]) by devirus-11.iastate.edu with smtp id 55fc_513b9fe4_4bcd_11de_844c_001372578af6; Thu, 28 May 2009 16:20:06 -0500 Received: from [129.186.226.91] (chronosnb1.geol.iastate.edu [129.186.226.91]) by despam-10.iastate.edu (8.14.2/8.12.10) with ESMTP id n4SLK5Jt000919 for ; Thu, 28 May 2009 16:20:05 -0500 Message-ID: <4A1F0006.9020202@iastate.edu> Date: Thu, 28 May 2009 16:20:06 -0500 From: Douglas Fils Organization: CHRONOS User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: find all unique field names Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.5.3.366731, Antispam-Engine: 2.7.0.366912, Antispam-Data: 2009.5.28.211040 X-ISUMailhub-test: Gauge=IIIIIII, Probability=8%, Report='BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_700_799 0, FROM_EDU_TLD 0, TO_NO_NAME 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __USER_AGENT 0' X-Virus-Checked: Checked by ClamAV on apache.org Forgive the noob question.. but I've not been able to easily locate an approach today to getting a return that gives all the unique field names in a couch database. It's not too hard to generate a map function that emits an array of the field names in a particular record.... (please note this is about as much JS as I have ever written) :) function(doc) { var i = 0; var keyNames = new Array(); for (var key in doc) { keyNames[i] = key i++; } emit(null,keyNames); } However, once I pass that over to the reduce (assuming this is even the way to do it) I don't see an easy way to get the unique intersection of the various field names. Any help would be appreciated... Thanks Doug