For development using python, objects must be passed in during mutate. Can I pass in strings for mutate?
Didn’t get you. Can you please elaborate what you are trying to do.
txn.mutate(set_obj=p) ,the parameter of mutate is an object, is there a way to pass in a string? I feel that strings are more flexible
I don’t think there is a direct way to achieve this. Internally, the object is converted to utf-8
encoding. It is done here. I agree that strings are more flexible, but it will also bring in quite a lot of rigidity on how it can be used. You’ll have to somehow specify if this is a delete mutation or set mutation. A quick hack to fit your need would be to modify this function and replace json.dumps(set_obj).encode('utf8')
with set_obj.encode('utf8')
.
By the way, can we get to know, why string argument would be better to have?