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 645079864 for ; Sun, 15 Jan 2012 15:16:04 +0000 (UTC) Received: (qmail 9707 invoked by uid 500); 15 Jan 2012 15:16:02 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 9599 invoked by uid 500); 15 Jan 2012 15:16:01 -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 9590 invoked by uid 99); 15 Jan 2012 15:16:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2012 15:16:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of manobi.oliveira@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qw0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2012 15:15:53 +0000 Received: by qadb17 with SMTP id b17so1073776qad.11 for ; Sun, 15 Jan 2012 07:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=crQtIlb+Ym4a4xtk1YC4v8dUoLy1LxbW1Ra4IhlKIHw=; b=LUw00Ulio0rMjm7x8zdH8ITDZX9iOJ6Zl4uZsevyPBV6yWw/x9qsqJzP8Wvvxof6me 8fqLPLwiinjgpCKp24SBcBusyImmaD5OiHTuN8/kD17yewbk2y0amXRkixWGWhaVUaIB x7NW6mz9OtWK4++VS7MQgJo7vPQEqxdnm2zNw= MIME-Version: 1.0 Received: by 10.224.98.2 with SMTP id o2mr10252580qan.74.1326640532929; Sun, 15 Jan 2012 07:15:32 -0800 (PST) Received: by 10.224.175.198 with HTTP; Sun, 15 Jan 2012 07:15:32 -0800 (PST) In-Reply-To: References: Date: Sun, 15 Jan 2012 13:15:32 -0200 Message-ID: Subject: Re: [object Object] instead of string From: Gabriel de Oliveira Barbosa To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf3074d9eeb5bd5704b69291af X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074d9eeb5bd5704b69291af Content-Type: text/plain; charset=ISO-8859-1 Just can't understand why in second how it working, given that all documents have the same structure: function map (doc){ for(var key in doc){ var output = {}; if(key != '_id' && key != '_rev'){ output[key] = doc[key]; emit(doc.page_id + ':' + doc.date, output); } } }; function reduce (keys, values, rereduce){ var hash = {}; values.forEach(function(pair){ for(var key in pair){ hash[key] = hash[key] || {}; hash[key][pair[key]] = (hash[key][pair[key]] + 1) || 1; } }); return hash; }; --20cf3074d9eeb5bd5704b69291af--