Structure of riak_object:get_value result

Mikhail Sobolev mss at mawhrin.net
Sat Apr 30 02:17:04 EDT 2011


Hi Kresten,

On Fri, Apr 29, 2011 at 12:18:11AM +0200, Kresten Krab Thorup wrote:
> At any rate, you'll already have a JSON decoder (mochijson2) when running inside Riak; so you can do
> 
> 	JSON = mochijson2:decode(Value)
> 
> To decode your JSON.  For the JSON document {"key":4, "val":{"x"="y"}} , that function should return 
> 
>  {struct, [{<<"key">>, 4}, 
>            {<<"val">>, {struct, 
>                          [{<<"x">>, <<"y">>}]}]}
> 
> 
> ... and you should be good to go.
Thanks for the example and reminding me that values are, in fact, of
arbitrary content :)

Now I can proceed further in my learning :)

--
Misha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110430/35ed3269/attachment.asc>


More information about the riak-users mailing list