incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Van de Velde <thomase...@gmail.com>
Subject Re: Emiting a Doc from Erlang View
Date Tue, 04 Oct 2011 13:34:33 GMT
Damian,

You can simply do this to emit a document from a view:

%% Map Function
fun({Doc}) ->
    ItemId = couch_util:get_value(<<"_id">>, Doc),
    Emit(ItemId,{Doc})
end.

On Tue, Oct 4, 2011 at 1:58 AM, Paul Davis <paul.joseph.davis@gmail.com>wrote:

> 2011/10/4 Damian DobroczyƄski <qoocku@gmail.com>:
> > 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 looked
> 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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message