Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 55643 invoked from network); 21 Nov 2009 22:59:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Nov 2009 22:59:29 -0000 Received: (qmail 7057 invoked by uid 500); 21 Nov 2009 22:59:28 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 6959 invoked by uid 500); 21 Nov 2009 22:59:28 -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 6949 invoked by uid 99); 21 Nov 2009 22:59:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Nov 2009 22:59:28 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nrstott@gmail.com designates 209.85.218.218 as permitted sender) Received: from [209.85.218.218] (HELO mail-bw0-f218.google.com) (209.85.218.218) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Nov 2009 22:59:20 +0000 Received: by bwz10 with SMTP id 10so4345264bwz.35 for ; Sat, 21 Nov 2009 14:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZXKRQ+wTm9V7npTxqSaq2zpD1MFaNx8Odpb1IC74u8A=; b=gHHBw5qn89ztnd9SDRRrAD/N+Drw+DdrlRHC/Qr5EVFQcQ+Meoxae3ZLguDu+oorLr XtinzOeTpuJr84kfnmCe3+0s45FDnkvjxugmZnGkW+UIW844H5D+KqknDzzTJHSfAige ejBjKQDD60bysNVnwVy7nvZFEcKHZRJZs17bE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=F+QEqwgJJGxhck3zKbeIGwR7NW/sdhzOrUyhihefWjrTA5BmBiG+IxarejDuilLmN5 MEMg7d6aVEbxul0uIvEg+E1v3gFgmO88PDBtKB7X6RWNloW4eCBwFK/3B60PqVHvl695 AIxKTZpflt/tjecVTPOajgoSaReu4O1YdQEnU= MIME-Version: 1.0 Received: by 10.204.26.147 with SMTP id e19mr2958294bkc.149.1258844339463; Sat, 21 Nov 2009 14:58:59 -0800 (PST) In-Reply-To: <2f84d03e0911211309w58359625na39a3af812200fa@mail.gmail.com> References: <2f84d03e0911211309w58359625na39a3af812200fa@mail.gmail.com> Date: Sat, 21 Nov 2009 16:58:59 -0600 Message-ID: Subject: Re: Counting unique items From: Nathan Stott To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000325557d26ae65e80478e989f8 X-Virus-Checked: Checked by ClamAV on apache.org --000325557d26ae65e80478e989f8 Content-Type: text/plain; charset=ISO-8859-1 You can pass reduce=false to turn off the reduce step of views with reduces if that helps On Sat, Nov 21, 2009 at 3:09 PM, Guy Moulton wrote: > Hello, > > I'm trying to get a count of the number of unique items in a database. > Documents look like this: > > Item: Item_A, User: Dave > Item: Item_A, User: John > Item: Item_A, User: Jane > Item: Item_B, User: John > Item: Item_B, User: Anne > > In the above example, I'd like to know that there are 2 items. So > far, I have a map/reduce that produces one view row for each kind of > item (similar to the example on the wiki) : > > key: "Item_A", value:"Null" > key: "Item_B", value:"Null" > > So the number I need is the number of rows in the view. > > According to the wiki, if I pass limit=0, it should give me the > meta-data, but this doesn't seem to work on views that have a reduce > function. I don't want to count rows in the client as there could > potentially be a very large number. > > Any ideas would be very much appreciated. > > Regards, > Guy > --000325557d26ae65e80478e989f8--