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 DA23E7EC8 for ; Tue, 4 Oct 2011 13:35:02 +0000 (UTC) Received: (qmail 13934 invoked by uid 500); 4 Oct 2011 13:35:01 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 13883 invoked by uid 500); 4 Oct 2011 13:35: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 13875 invoked by uid 99); 4 Oct 2011 13:35:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2011 13:35:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thomasevdv@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2011 13:34:54 +0000 Received: by eyb6 with SMTP id 6so598692eyb.11 for ; Tue, 04 Oct 2011 06:34:33 -0700 (PDT) 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=4yuHZ3AYTkvwylhPEV/DVd2DcXiqHxzgZoRpFY0T1GA=; b=dTAr9t8+ks77YgKotdjsfhllGWphkTBppskkKoS2q72rmRuRg829qnr+5FWrGMEsO5 M7MUQeWywoDoq5YNbwTEqwYwWwdCBYjmzYG9lmVeMnmDW6oyDSQKUHq10EOtoxwOXJvv HCXdIvmJIDMw+5EFqKx+nkUXMfhxR0la5r/50= MIME-Version: 1.0 Received: by 10.223.95.139 with SMTP id d11mr1766520fan.117.1317735273480; Tue, 04 Oct 2011 06:34:33 -0700 (PDT) Received: by 10.152.9.97 with HTTP; Tue, 4 Oct 2011 06:34:33 -0700 (PDT) In-Reply-To: References: <4E8AA900.30900@gmail.com> Date: Tue, 4 Oct 2011 08:34:33 -0500 Message-ID: Subject: Re: Emiting a Doc from Erlang View From: Thomas Van de Velde To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0ce0b13ee2406804ae792661 --000e0ce0b13ee2406804ae792661 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Damian, You can simply do this to emit a document from a view: %% Map Function fun({Doc}) -> ItemId =3D couch_util:get_value(<<"_id">>, Doc), Emit(ItemId,{Doc}) end. On Tue, Oct 4, 2011 at 1:58 AM, Paul Davis wro= te: > 2011/10/4 Damian Dobroczy=C5=84ski : > > W dniu 03.10.2011 02:52, Thomas Van de Velde pisze: > >> Hi, > >> > >> How can I emit the document as part of an Erlang view? > Emit(Something,*Doc*) > >> doesn't work. > >> > >> Is there a good sample app or set of unit tests to look though? I look= ed > at > >> the test that ships with Futon but it doesn't show this. > >> > >> Thanks! > >> > >> Thomas > >> > > > > Still, nobody's answered this question ... :D > > So, is it possible at all? > > > > -- D. > > > > > > Of course. Pretty sure answered in a separate thread related to this. > > Answer: Same as in JavaScript. Just emit it. > --000e0ce0b13ee2406804ae792661--