W dniu 04.10.2011 15:34, Thomas Van de Velde pisze: > 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. > Yep, I've just learned (after to hours of struggling...). CouchDb encodes JSON in Erlang as a list of two-element tuples packed into a tuple ;) > On Tue, Oct 4, 2011 at 1:58 AM, Paul Davis wrote: > >> 2011/10/4 Damian DobroczyƄski : >>> 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. >> >