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 3FCA768EA for ; Mon, 16 May 2011 15:35:34 +0000 (UTC) Received: (qmail 41480 invoked by uid 500); 16 May 2011 15:35:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 41455 invoked by uid 500); 16 May 2011 15:35:32 -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 41447 invoked by uid 99); 16 May 2011 15:35:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2011 15:35:32 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,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 sean.copenhaver@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 May 2011 15:35:26 +0000 Received: by vws16 with SMTP id 16so4861121vws.11 for ; Mon, 16 May 2011 08:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=B3uI7Dh/PsITl3baJw1PmbMROA61UunYC18jFbpSD5Q=; b=CyQBFtxkNW85hfubMwIO7kAORpinKnjqyIqxL/Hjif95V1+3eabzqWt60TuFKUuE5Q kDTDQ/Fou0ocy1OLlQM6ZLklsIeXyU9ih1beZLTZnJeXVmDG4UbRMD7q491DKp3VeaLX XczwU1OWr0zVYZTPXN86Xv8g7szB/KGmaFa1E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QyscrTESR0HmC1ELApIYlk+jhWSMmPQbvw/MZR9s7x/4z115fZB35JTCqg81ePgQdU nzw3Yvssy/24yG9jP7bOYJzBxc0OU0J1JSeEjPQf4d1IAcOKX6s/BLhzOJ5UsKAV64cU UzgaoqYiPpULDRbev+D/UJ83oUqz34XbNLtWA= MIME-Version: 1.0 Received: by 10.52.73.2 with SMTP id h2mr3974192vdv.104.1305560105734; Mon, 16 May 2011 08:35:05 -0700 (PDT) Received: by 10.52.115.99 with HTTP; Mon, 16 May 2011 08:35:05 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 May 2011 11:35:05 -0400 Message-ID: Subject: Re: convert data query into map/reduce function From: Sean Copenhaver To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf3071c9fe55d1a904a3666697 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3071c9fe55d1a904a3666697 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Usually the convention is you have some kind of 'type' attribute (so type checking) on your documents or you check that all the fields you are interested in exist (more of the duck approach) in your map function. So perhaps your map function is something like: function(doc){ if (doc.type !=3D 'line_item') return; var value =3D { emit([doc.l_shipdate, doc.l_returnflag, doc.l_linestate], { } On Mon, May 16, 2011 at 11:06 AM, Mauro Fagnoni wr= ote: > Stefan I'm trying to convert this sql query in an identical to the docume= nt > I created in couchdb. Unfortunately, it is the first time using this > database and would like to understand how to translate the query using on= ly > the wiki because I have not figured out how to do a lot > > 2011/5/16 Stefan Matheis > > > i think a short example would be really helpful .. especially related > > to your data-structure .. and the expected behaviour. do you already > > have an reduce function, but it does not work like you'd have it to? > > > > > > -- > ----------------------------------------------- > [-------WHOAMI------] Mauro Fagnoni > [----------ICQ#---------] 279572903 > [--------MSNID--------] maurofagnoni@yahoo.it > [--YAHOOMSNID--] maurofagnoni@gmail.com > [--GOOGLETALK--] mauro.fagnoni@gmail.com > [-GOOGLEWAVE-] mauro.fagnoni@googlewave.com > [------JABBER-------] mauro.fagnoni@gmail.com > [------SKYPE--------] mauro.fagnoni > [-----LinuxUser#----] 346345 > [----------Blog---------] http://kingmauro.wordpress.com > ----------------------------------------------- > --=20 =93The limits of language are the limits of one's world. =93 -Ludwig von Wittgenstein --20cf3071c9fe55d1a904a3666697--