Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16CA5DBC7 for ; Tue, 6 Nov 2012 14:15:38 +0000 (UTC) Received: (qmail 21658 invoked by uid 500); 6 Nov 2012 14:15:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 21623 invoked by uid 500); 6 Nov 2012 14:15:36 -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 21606 invoked by uid 99); 6 Nov 2012 14:15:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 14:15:36 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [91.195.24.3] (HELO mail.open.bg) (91.195.24.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 14:15:25 +0000 Received: from [78.83.28.88] (port=58984 helo=eee-az) by mail.open.bg with esmtpsa (Cipher SSL3.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.77) id 1TVjvg-0003CS-Ra by authid with login for ; Tue, 06 Nov 2012 16:15:00 +0200 Date: Tue, 6 Nov 2012 16:17:58 +0200 From: svilen To: user@couchdb.apache.org Subject: Re: Any sort order guarantee for key (value) argument of CouchDB reduce function? Message-ID: <20121106161758.5e88a41d@eee-az> In-Reply-To: References: X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org no, see reponses to my thread "what's the order of docs/keys going into reduce func?" from 22.09. for small sets, it's reversed but that seems just a local consequence of some algo. ciao svilen On Tue, 6 Nov 2012 16:55:57 +0400 Vladislav Ponomarev wrote: > Hello, > > Per CouchDB guide, the reduce function signature looks like this: > > function (key, values, rereduce) { > return ...; // some calculations happen here > } > > where the definition of first arguments is as follows: > > > > > when rereduce is false, then: > > > > - key will be an array whose elements are arrays of the form > > [key,id], where key is a key emitted by the map function and id is > > that of the document from which the key was generated. > > - values will be an array of the values emitted for the > > respective elements in keys. > > > > > My question is: when rereduce is false, are there any guarantees > regarding the order of key (or values) array elements? My gut feel > (based on Reduce vs Rereduce chapter) is that keys, and respectively > values, should be ordered, but I do not see any direct confirmation. > > > > Any ideas? Thank you!