That was easy. we simply request the objects by key. in the last
example, we converted to JSON so we can compare a string key to a symbol
key.

Updating Objects In Riak

While some data may be static, other forms of data may need to be
updated. This is also easy to accomplish. Let’s update the value of
myValue in the 3rd example to 42.

fetched3.data["myValue"] = 42
fetched3.store()

Deleting Objects From Riak

As a last step, we’ll demonstrate how to delete data. You’ll see that
the delete message can be called either against the bucket or the
object.

my_bucket.delete('one')
obj2.delete()
obj3.delete()

Working With Complex Objects

Since the world is a little more complicated than simple integers and
bits of strings, let’s see how we can work with more complex objects.
Take, for example, this Ruby hash that encapsulates some knowledge about
a book.

JSON! The Ruby Riak client will serialize objects to JSON when it comes
across structured data like hashes. For more advanced control over
serialization you can use a library called
Ripple, which is a rich Ruby modeling
layer over the basic riak client. Ripple falls outside the scope of
this document but we shall visit it later.