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 7DE0E426D for ; Fri, 27 May 2011 03:11:40 +0000 (UTC) Received: (qmail 17725 invoked by uid 500); 27 May 2011 03:11:38 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17700 invoked by uid 500); 27 May 2011 03:11:38 -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 17692 invoked by uid 99); 27 May 2011 03:11:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2011 03:11:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of torsteinkrausework@gmail.com designates 209.85.161.180 as permitted sender) Received: from [209.85.161.180] (HELO mail-gx0-f180.google.com) (209.85.161.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 May 2011 03:11:28 +0000 Received: by gxk10 with SMTP id 10so807254gxk.11 for ; Thu, 26 May 2011 20:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=dMbI9DUxLGgSiVa841iCGZQbc/87JojuvC0epo7l6Kk=; b=dvfu3DNHuvnf0v3JrGu73tueZUL4GPIpa+BX84YKgCGbWI73r65yiWbNIkJ+UdD3oy R/NOOgU/FbOCS0uPKIeDTqNkEI13HnL7o/v+EymKD2KxS/HlKPCbP9CGzjMCDHg7eKDj Fa5QwkdtWlCp/GWROulERpVKO86/SvyStpqGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=dfV6IH1czAbQELZwWpd7EK6BfHGx328xQlVf/hMm5+wMK8ZVrWGUO9ERhpAqw+fAn8 RWNvGCkB8NkREE7+z1fzRHVdk0+/2zBtJLCwYPl0mcDueS2oVfrWviDeSu3y8+5mvaJ2 tkPx8fC5SIuw5DpWFXXgkHD8YuJzsHWrYUMlI= Received: by 10.101.175.33 with SMTP id c33mr1146989anp.93.1306465867564; Thu, 26 May 2011 20:11:07 -0700 (PDT) Received: from [192.168.1.105] (114-44-176-76.dynamic.hinet.net [114.44.176.76]) by mx.google.com with ESMTPS id o6sm1126123ank.42.2011.05.26.20.11.05 (version=SSLv3 cipher=OTHER); Thu, 26 May 2011 20:11:06 -0700 (PDT) Message-ID: <4DDF164A.7030009@gmail.com> Date: Fri, 27 May 2011 11:11:06 +0800 From: Torstein Krause Johansen User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110402 Icedove/3.1.9 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Complex queries & results References: <4DDDFD4E.9060701@gmail.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi all, thanks for the great feedback. On 26/05/11 19:26, Sean Copenhaver wrote: > Have you tried having a map function that emits the 'a_name' as a key then a > reduce function that uses the builtin sum(), then you query with group=true? If I do: emit([a_name, one_id, another_id, created_at]); I can query it with (reduce just being the built in _count) group=true&group_level=1 and by that get the dictionary I wanted: { "Lisa" : 1 "John" : 3 } I know need to make the start and endkey parameters ignore the first element of my key as a_name is not a search parameter. I've tried with this search for one_id=1, another_id=2 and date between 2011-05-26 and 2011-05-27: startkey=[{},1,2,"2011-05-26"]&endkey=[{},1,2,"2011-05-27"] But don't get anything returned. Am I doing this wrong? Is there a different way to make the view ignore the first element of the key? In the coucdb.log I can see that my query parameters enter Couch the way I intended (no BASH escaping going astray). Cheers, -Torstein