Client to the datastore-backend.
gem install datastore-client
# connect to local
client = Datastore::Client.new('http://datastore-backend.dev')
client.get(uuid, token)
If there is no data set for that UUID, nil
is returned.
client.get([uuid1, uuid2], token) # => {uuid1 => {"some" => "data"}, uuid2 => {"more" => "data"}}
If there is no data set for a UUID it won't show up in the result.
data_set = {hello: 'world'}
client.set(uuid, token, data_set)
The client will automatically create a set if the UUID has no set in the given scope yet.
It is also possible to only update a certain key inside of the data set:
data_set = {hello: 'world', bli: {bla: 'blub'}}
# create the set
client.set(uuid, token, data_set)
# now update the thing to read: {hello: 'world', bli: {bla: 'blob'}}
client.set(uuid, token, 'blob', key: 'bli/bla')