Hi Can,

Only dict:fetch throws an exception; dict:find/2 will return {ok, Value} or
'error'. You can handle 'error' in your case statement.

Are you using the metadata dictionary from the object or the object itself
in your call to dict?

Thanks,
Dan

Daniel Reverri
Developer Advocate
Basho Technologies, Inc.
[email protected]


On Tue, Dec 6, 2011 at 11:24 AM, Can Arel <[email protected]> wrote:

> Hi everyone,
> A kind of silly question perhaps but here we go.
> I am following the tutorials at the basho site and when I get to the part
> where I want to add Links to the metadata in the object , I am having some
> difficulties with the binary <<"Links">>.
> When you create a riakc_object is that particular binary(<<"Links">>)
> there automatically or does it have to be inserted?
> I am trying to create functions that insert the value(<<"Links">>,[]) in
> the object after it has been created but it doesn't feel right.
> Why I am mostly confused is that if you use dict:fetch or dict:find on an
> object without any links it throws an exception which I can't handle in a
> case statement.
>
> Please let me know if anything is unclear and I would appreciate any
> feedback.
>
> Kind Regards,
> Can
>
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to