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 <[email protected]>wrote:

> 2011/10/4 Damian Dobroczyński <[email protected]>:
> > 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.
>

Reply via email to