Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 62417 invoked from network); 8 Oct 2009 03:16:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Oct 2009 03:16:15 -0000 Received: (qmail 36174 invoked by uid 500); 8 Oct 2009 03:16:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 36028 invoked by uid 500); 8 Oct 2009 03:16:13 -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 36018 invoked by uid 99); 8 Oct 2009 03:16:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 03:16:13 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: unknown ?allinclude:aspmx.googlemail.com (nike.apache.org: encountered unrecognized mechanism during SPF processing of domain of paco@freshout.us) Received: from [209.85.210.203] (HELO mail-yx0-f203.google.com) (209.85.210.203) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Oct 2009 03:16:02 +0000 Received: by yxe41 with SMTP id 41so11747473yxe.30 for ; Wed, 07 Oct 2009 20:15:41 -0700 (PDT) Received: by 10.150.240.4 with SMTP id n4mr1413948ybh.1.1254971741243; Wed, 07 Oct 2009 20:15:41 -0700 (PDT) Received: from ?10.0.0.17? ([189.192.15.37]) by mx.google.com with ESMTPS id 13sm922925gxk.5.2009.10.07.20.15.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Oct 2009 20:15:40 -0700 (PDT) Message-Id: <2303E332-F34D-40BD-AB07-85F288D2A8B6@freshout.us> From: Francisco Viramontes To: user@couchdb.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: different results for same group levels Date: Wed, 7 Oct 2009 22:15:38 -0500 X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org I have a views problem that I dunno if can be solved by couch here is my map function: function(doc) { if ((doc['couchrest-type'] == 'DataValue') && doc['device_variable_id']) { date = new Date(doc.date_time); emit([doc.device_variable_id, date.getFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), parseInt(date.getUTCMinutes() / 20) ], doc.value); } } Please just min the last key portion emited -> parseInt(date.getUTCMinutes() / 20) I use this to sum in groups of values of data for every 20 minutes I DONT want to make another view if say for example I want to emit for 5 minutes Views already take too much space!!! Is there a view I can make that handle conditional key emiting or something that I can pass a parameter to? PAco