How would one create a simple Riak CRDT Map containing a Register name username and value test? I am looking at this documentation here but don't understand how XPath and name of the register in a map are connected.
Here is what I will like to do: create/update a Map with Register name username and value test (under bucket type mapbucket, bucket uinfo, key test1). Here is how Erlang client will do that (not tested - modified copy-paste from another code I wrote):
Map = riakc_map:new(),
Map1 = riakc_map:update({<<"username">>, register},
fun(R) -> riakc_register:set(<<"test">>, R) end,
Map),
{ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", 8087),
riakc_pb_socket:update_type(Pid,{<<"mapbucket">>,<<"uinfo">>},"test1",riakc_map:to_op(Map1))
I searched github code repository, but couldn't find any example of doing it in Haskell Riak client. I will very much appreciate it if any one with familiarity with Haskell Riak client, and CRDT ops could provide pointers on how to do something like above.