Problem with r_object and riak-erlang-client compatibility

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem with r_object and riak-erlang-client compatibility

Alex Turkin
Hello guys,

I have following case:

I get the list of objects from riak by mapreduce, and then want to change some of them, and update it via riakc_pb_socket:put.

But the problem is, that

riakc_pb_socket:mapred(
    Conn,
    Index
    [{map, {modfun, riak_kv_mapreduce, map_identity}, undefined, true}]
).

returns list of #r_object{}, when riakc_pb_socket:put requires #riakc_obj{}.


What's the best way to solve the problem?
Is there some convenient way to do it rather than writing my own convertion function? I don't want to be dependent on riak internal data structures in my code...


PS I've seen the thread with the same question http://riak-users.197444.n3.nabble.com/MapReduce-returned-value-can-t-be-processed-by-riakc-obj-get-value-td3862992.html but there's no appropriate solution for me.