Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete a key/value pair from a map #67

Open
doublej74 opened this issue Sep 22, 2020 · 0 comments
Open

Unable to delete a key/value pair from a map #67

doublej74 opened this issue Sep 22, 2020 · 0 comments

Comments

@doublej74
Copy link

doublej74 commented Sep 22, 2020

I'm trying to delete a register from a map, also trying to delete a counter from a map.

Code:
map = Riak.find("maps", "test_maps", "test1")
Riak.CRDT.Map.delete(map, "test_reg")
|> Riak.update("maps", "test_maps", "test1")

Error:
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in :riak_pb_dt_codec.encode_map_field/1
(riak_pb 2.3.2) src/riak_pb_dt_codec.erl:116: :riak_pb_dt_codec.encode_map_field("reg1")
(riak_pb 2.3.2) src/riak_pb_dt_codec.erl:428: :riak_pb_dt_codec.encode_map_op_update/2
(riak_pb 2.3.2) src/riak_pb_dt_codec.erl:473: :riak_pb_dt_codec.encode_operation/2
(riak_pb 2.3.2) src/riak_pb_dt_codec.erl:500: :riak_pb_dt_codec.encode_update_request/4
(riakc 2.5.3) src/riakc_pb_socket.erl:1246: :riakc_pb_socket.update_type/5
(riak 1.1.6) lib/riak.ex:264: Riak.update/4

I tried many different ways to delete a key/value pair from a map, but unable to do so.
Am I doing something wrong?
I am able to update a map when replacing a key/value pair by using the put function instead of the delete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant