David,
Adding to what Michael said, an idiomatic pattern I've been using is:
obj = kv.bucket(b).get(name)
data = f.get_data() or {'my_list': []}
data['my_list'].append(something)
obj.set_data(data)
obj.store()
[usually it's `f.get_data() or {}` when I use it, but you should see the
pattern.]
David,
The way you're doing it is correct. As far as I can tell populate is
mostly meant for internal use similar to set_siblings which has this
comment in the code
Set the array of siblings - used internally
Not sure why they arnt using the convention of setting internal methods
with _
Hi folks,
Simple question here. Based on the python client documentation, I'm unclear on
the canonical means to perform in python a read-modify-write cycle on an object
stored in Riak.
What seems intuitive to me:
obj = kv.bucket(b).get(name)
if f.exists():
data = f.get_data()