From couchdb-user-return-1910-apmail-incubator-couchdb-user-archive=incubator.apache.org@incubator.apache.org Tue Nov 18 12:28:05 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 54005 invoked from network); 18 Nov 2008 12:28:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Nov 2008 12:28:05 -0000 Received: (qmail 34548 invoked by uid 500); 18 Nov 2008 12:28:12 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 34510 invoked by uid 500); 18 Nov 2008 12:28:11 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 34498 invoked by uid 99); 18 Nov 2008 12:28:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 04:28:11 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of adam.groves@gmail.com designates 74.125.44.152 as permitted sender) Received: from [74.125.44.152] (HELO yx-out-1718.google.com) (74.125.44.152) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 12:26:50 +0000 Received: by yx-out-1718.google.com with SMTP id 36so1224074yxh.0 for ; Tue, 18 Nov 2008 04:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=rt38u6RNy6WEwmpDCVAjsrYGk9FN3eAgPF0SSWcDSa0=; b=rO84lBm0bjnCOpJglVEPGrw0BvwccuVyEKu4eCKCgH7r/RIAnoNpQG61kyDwDCQaxK Qon79tnzHYhMjFM2/NbN3Anp/mCXcJ65EPEjxfq/SuZyP1uux7SEE+Q2/zYmL7L0rIjx Vn1x95x6F0tu4CXjD1gpUwnkSRRl0RwlhWDno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=ub9XEjhR3q2DsB53JbgN9ZpP5pnLUxPL9/R8bVPR5QF5DM5m9xT8g8aIFgnZbUa03n pSipZrysCMcZvvKcX7iGtqDdpOdkKqNR4zXyL7qfvbX1K5MpC9pFdJgXB1inUszc9D7C FltXCEnY51RtzIexYpAK8GtK49vp6ksbPeWZw= Received: by 10.100.209.5 with SMTP id h5mr2082836ang.79.1227011255107; Tue, 18 Nov 2008 04:27:35 -0800 (PST) Received: by 10.101.71.8 with HTTP; Tue, 18 Nov 2008 04:27:35 -0800 (PST) Message-ID: Date: Tue, 18 Nov 2008 13:27:35 +0100 From: "Adam Groves" To: couchdb-user@incubator.apache.org Subject: View with incremental counter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi, I've got the following view: count = 0; function(doc) { if(doc.type == "document") { count = count + 1 emit(doc._id, count); } } The idea is that I get a list of documents, each having a counter value which is incremental. I expected the count values to come out in order, but that isn't the case: my first few documents have values of 62, 61, 22, 19. I'm not quite sure what's going on here - any ideas how the order is being set here? Regards Adam Groves