repro with aerospike:ce-5.7.0.16, python 3.9.11 and python aerospike library 7.0.1
import aerospike
from aerospike_helpers.operations import map_operations
ac = aerospike.client({'hosts': [('localhost', 3000)]})
ac.connect()
key = ('test', 'test', 'test')
try:
ac.remove(key)
except:
pass
ac.put(key, {'map': {'key': 'value'}})
print(ac.get(key)[2])
ac.operate(
key,
[
map_operations.map_put(
bin_name='map',
key='key',
value=aerospike.null())]
)
print(ac.get(key)[2])
prints
{'map': {'key': 'value'}}
{'map': {'key': None}}
i know there’s the remove operation but it makes using map_put_items
less ergonomic for many map put ops (when some are removals), also i imagined the map items would behave similarly to bins (being removable with aerospike.null()
) but maybe this isn’t justified?