Closed phasetri closed 4 years ago
I can confirm that MapPutOp
works at least with map-type values; I can just marshal the struct into a map.
Dear @phasetri,
Do I understand right that it is impossible to use MapPutOp
in this case? What do you use instead now to update a value of the map by a key?
Would be very grateful for your reply!
I still use MapPutOp for this case. MapPutOp works out-of-the-box when setting primitive values like int, string, and float. But when you want to set a map value to a non-primitive value like a Struct, you need to convert the struct into a map before passing it to MapPutOp.
Thank you for your reply! We have decided that in our case it is ok to use GetObject (with aerospike tags as
), update a map as you want, and put it back with PutObject. At least for now :)
Hello again
I have a record in the database where one of the bins (i.e. Passengers) is a map:
Using the
MapPutOp
function, I can append simple KV pairs to the map, such {Nick: 2}. However, if try appending a KV pair where the value is a struct:I encounter a packing error:
Is there a way to get around this? I looked through
cdt_map_test.go
but haven't seen any examples of appending struct values to a map.