Skip to content

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

@doublej74

Description

@doublej74

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions