From user-return-5680-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue Jul 28 00:33:35 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 25143 invoked from network); 28 Jul 2009 00:33:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jul 2009 00:33:35 -0000 Received: (qmail 78351 invoked by uid 500); 28 Jul 2009 00:34:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 78252 invoked by uid 500); 28 Jul 2009 00:34:39 -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 78242 invoked by uid 99); 28 Jul 2009 00:34:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jul 2009 00:34:39 +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 jochenkempf@gmail.com designates 209.85.217.221 as permitted sender) Received: from [209.85.217.221] (HELO mail-gx0-f221.google.com) (209.85.217.221) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jul 2009 00:34:29 +0000 Received: by gxk21 with SMTP id 21so6314967gxk.3 for ; Mon, 27 Jul 2009 17:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=n3BQxgN69gY2+m1QivHclqS9nYlI7SCZjIR10Q+eND4=; b=FeJHKqXyH/UH33S7Q9hUhu43DvcaRlVf3enpr9z6bM1tzI6mmaFc0t0mNySiHVK2Mq 164S5EUxoY5D5jCconCfePiPOeoEhkcugxnO/hKCRtwc/p/eci8Qe/4nSRXTwcrvUoFv ZHi5vnU4JjYCWcJLbwy6bZD2pLLB/I+4o7Sr4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=GciZ6Bd+oen6Hv/l7MnMctz/omOAqbLhbTWpEGNNLS+Xc3MZlV4mzGH0jPMRT4yeRz OTkqXYbfeEOg6+4e8pVUsD17/Yw6g3PbK0TxQ3aQK8nJwU4D9Ghw7FYt7r5OOCt3Hdp4 uzd0O63ONjJSHP+8LG6dxugHW43M38lbzJKHA= MIME-Version: 1.0 Received: by 10.90.50.5 with SMTP id x5mr6487639agx.63.1248741248385; Mon, 27 Jul 2009 17:34:08 -0700 (PDT) From: Jochen Kempf Date: Mon, 27 Jul 2009 20:33:48 -0400 Message-ID: <6d692b470907271733o3edca47aj4b4664fb0abeb559@mail.gmail.com> Subject: Problems with reduce in view appear when record size > 6 To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=00163630f1df86cd01046fb93a3e X-Virus-Checked: Checked by ClamAV on apache.org --00163630f1df86cd01046fb93a3e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, I am experiencing a problem when using a reduce in the following way: First, I define a map function returning at least 4 values (here i define 6 values) --> > function(doc) { > emit(doc["_id"], [doc["_id"], doc["_rev"], doc["var1"], doc["var2"], > doc["var3"], doc["var4"], doc["var5"]]); > } Until here, everything works fine! But once I define the following reduce function it stops working from 6 or 7 records on upwards (if the total record size of the corresponding database is < 6 it works fine): > function(key, values, combine) { > var ids = []; > var revs = []; > var variables = []; > for (i in values) { > ids.push(values[i][0]); > revs.push(values[i][1]); > variables.push([values[i][2], values[i][3], values[i][4], > values[i][5], values[i][6]]); > } > return [ids, revs, variables]; > } This is the error message: > Error: case_clause > {{badmatch,<<"Cannot encode 'undefined' value as JSON">>}, > [{couch_query_servers,'-rereduce/3-fun-0-',3}, > {lists,zipwith,3}, > {couch_query_servers,rereduce,3}, > {couch_view_group,'-init_group/4-fun-0-',4}, > {couch_btree,'-write_node/3-lc$^0/1-0-',3}, > {couch_btree,write_node,3}, > {couch_btree,complete_root,2}, > {couch_btree,query_modify,4}]} > Anyone knows what is going on? --00163630f1df86cd01046fb93a3e--