riakc doesn't save metadata properly?

David Parfitt dparfitt at basho.com
Mon Oct 22 17:25:35 EDT 2012


Hello Metin -

I'm trying to get that into the docs right now. Will italics do? :-)
https://github.com/basho/riak-erlang-client/pull/74

Cheers -
Dave

On Mon, Oct 22, 2012 at 5:22 PM, Metin Akat <akat.metin at gmail.com> wrote:
> Oh, I see, thanks for this clarification, much appreciated.
> I think this should be written somewhere in bold, as 3 days later, I still
> wasn't able to find anything on google.
>
>
> On Tue, Oct 23, 2012 at 12:08 AM, David Parfitt <dparfitt at basho.com> wrote:
>>
>> Hello Metin -
>>
>>   Sorry for the delay. At the moment, all metadata needs to be stored
>> under the <<"X-Riak-Meta">> dict key. The following example
>> illustrates how this works:
>>
>> %% To store metadata:
>> Object = riakc_obj:new(<<"groceries">>, <<"mine">>, <<"eggs & bacon">>).
>> MetaData  = dict:from_list([{<<"X-Riak-Meta">>, [{"Foo", "Bar"}]}]),
>> Object2 = riakc_obj:update_metadata(Object, MetaData).
>> riakc_pb_socket:put(Pid, Object2).
>>
>> %% To retrieve metadata:
>> {ok, O} = riakc_pb_socket:get(Pid, <<"groceries">>, <<"mine">>).
>> {ok, MD} = dict:find(<<"X-Riak-Meta">>, riakc_obj:get_metadata(O)).
>>
>> We're kicking around ways to improve this in the future.
>>
>> Cheers -
>> Dave
>>
>> On Fri, Oct 19, 2012 at 8:31 AM, Metin Akat <akat.metin at gmail.com> wrote:
>> > I am trying to do something like:
>> >
>> >     Meta1 = dict:store(<<"ver">>, Ver, Meta0),
>> >     Obj1 = riakc_obj:update_metadata(Obj, Meta1),
>> >
>> > and then save the object. But on a subsequent read, the metadata k/v
>> > pair is
>> > not there.
>> >
>> > Is there anything special that needs to be done for this to work, or is
>> > this
>> > illegal way to use Riak?
>> >
>> > _______________________________________________
>> > riak-users mailing list
>> > riak-users at lists.basho.com
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> >
>
>




More information about the riak-users mailing list