hello,

I searched the archives and I didn't see this mentioned; I'm sure I'm
missing something here.

I'm using riak-client 1.2, riak 1.3.1, and the http interface.  When I add
a string metadata and store the object, it returns an array.  If I store it
again, it returns an array where the first element is the json string of
the previous array.  Storing it again creates another nested level, and so
on.   See the following example

client = Riak::Client.new  #defaults to using the http client
bucket = client.bucket('my_bucket')
obj = bucket.new(client.stamp.next.to_s)
obj.data = 'my data'
obj.meta['foo'] = 'bar'
obj.store
=> #<Riak::RObject {my_bucket,5741658058644260329} [#<Riak::RContent
[application/json]:"my data">]>
obj.meta
=> {"foo"=>["bar"]}
obj.store
=> #<Riak::RObject {my_bucket,5741658058644260329} [#<Riak::RContent
[application/json]:"my data">]>
obj.meta
=> {"foo"=>["[\"bar\"]"]}

however, when I do this with protocol buffers, it works correctly as
expected.

Any suggestions?  I can provide a patch to hack this in the
http_backend/object_methods.rb class, but it seems like this might be a
'quirk' of the server?  I'm new to riak so again, I do wonder if I'm
missing something!

thanks,
adam
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to