On Jun 3, 2010, at 10:40 AM, Mike Keen wrote:
> I've been playing with Erlang views on and off in CouchDB, and find the
> information on the internal Erlang structure of Docs lacking. Is there
> somewhere I can read up on this? I had initially assumed that a Doc was a
> list of tuples, but I am starting to suspect that I am wrong.
>
It's an erlang proplist, wrapped in a single tuple, so:
{[{<<"key">>, value()}, {<<"other-key">>, value()}]}
Where value() is any valid eJSON.
So you can do eg:
{Props} = Doc,
V1 = couch_util:get_value(<<"key">>, Props)
> Mike