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 886E417C74 for ; Thu, 5 Feb 2015 19:24:34 +0000 (UTC) Received: (qmail 94172 invoked by uid 500); 5 Feb 2015 19:24:28 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 94103 invoked by uid 500); 5 Feb 2015 19:24: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 94092 invoked by uid 99); 5 Feb 2015 19:24:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2015 19:24:27 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kiril@open-net.biz designates 188.138.38.206 as permitted sender) Received: from [188.138.38.206] (HELO open-net.biz) (188.138.38.206) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2015 19:24:23 +0000 Received: from [88.87.6.162] (port=49288 helo=[192.168.69.105]) by teddy.icnhost.net with esmtpsa (UNKNOWN:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1YJRzs-0001K2-RR for user@couchdb.apache.org; Thu, 05 Feb 2015 20:21:53 +0100 Message-ID: <54D3C2C1.8090607@open-net.biz> Date: Thu, 05 Feb 2015 21:21:37 +0200 From: Kiril Stankov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Reducing on all emitted docs References: <54D3BD89.10907@open-net.biz> In-Reply-To: Content-Type: multipart/alternative; boundary="------------020908070703040404080903" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - teddy.icnhost.net X-AntiAbuse: Original Domain - couchdb.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - open-net.biz X-Get-Message-Sender-Via: teddy.icnhost.net: authenticated_id: kiril@open-net.biz X-Virus-Checked: Checked by ClamAV on apache.org --------------020908070703040404080903 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Just found that... :) Sorry, a bit more googling next time. BTW, I use CouchDB for less than a month and I'm in love! Thanks all! ------------------------------------------------------------------------ *With best regards,* Kiril Stankov This Email disclaimer is integral part of this message. On 2/5/2015 9:08 PM, Giovanni P wrote: > running this with group=true will give you the sum per type, with > group=false (or without any mention of "group") you'll get the total sum. > > On Thu, Feb 5, 2015 at 4:59 PM, Kiril Stankov wrote: > >> Hi, >> >> I want to get the sum of values from all results, produced by the map >> function. >> Something like this: >> >> ||| "|map|":|"function(doc) {\n emit(doc.type, doc.total);\n}"|, >> "|reduce|":|"_sum"|||| >> >> >> Running this gives me sum per 'doc.type'. >> I wonder if I can get the sum easily for all 'doc.total' values across all >> documents, while still keeping the type as key for the map. >> >> Thanks in advance! >> ------------------------------------------------------------------------ >> *With best regards,* >> Kiril Stankov >> >> On 2/4/2015 2:37 AM, Ayhan Kesenci wrote: >> >>> I export a view with a curl command >>> >>> and the view looks like this in the map >>> >>> function(doc) { >>> emit([doc.user.friends_count, >>> doc.user.followers_count,doc.retweet_count,doc.text], doc.id_str); >>> } >>> >>> >>> is it possible to surround the for example doc.user.friends_count with >>> quote signs, to have it like this with the usual comma between the quote >>> signs? >>> >>> >>> "doc.user.friends_count"," >>> doc.user.followers_count","doc.retweet_count","doc.text" >>> >>> thank you >>> >>> 2015-02-04 1:31 GMT+01:00 Ayhan Kesenci : >>> >>> I export a view with a curl command >>>> and the view looks like this in the map >>>> >>>> function(doc) { >>>> emit([doc.user.friends_count, >>>> doc.user.followers_count,doc.retweet_count,doc.text], doc.id_str); >>>> } >>>> >>>> >>>> is it possible to surround the for example doc.user.friends_count with >>>> quote signs, to have it like this with the usual comma between the quote >>>> signs? >>>> >>>> >>>> "doc.user.friends_count"," >>>> doc.user.followers_count","doc.retweet_count","doc.text" >>>> >>>> >>>> --------------020908070703040404080903--