Closed GoogleCodeExporter closed 9 years ago
Hi,
The old merge update function has been replaced in Terrastore 0.8.1 by the
merge operation described here:
http://code.google.com/p/terrastore/wiki/Developers_Guide#Merge_update
So, are you referring to the old (0.8.0 and before) merge update, or the new
one (0.8.1 and above)?
Original comment by sergio.b...@gmail.com
on 5 Apr 2011 at 5:24
[deleted comment]
Sorry,
it does not work, but with version >0.8.0 its all fine.
should be
it does not work, but with version <0.8.1 its all fine.
We are using version 0.8.0, but we want to switch to 0.8.1. I cant find any
differences in the merge docs and i dont know why its not working with version
0.8.1. What has been changed between 0.8.0 and 0.8.1 ?
We used this syntax in 0.8.0:
POST /myBucket/myKey/update?function=merge&timeout=10000
{"value2" : "merged"}
And it should be the same within 0.8.1.
But it does not work. Just 400 Responses....
Original comment by schultem...@gmail.com
on 5 Apr 2011 at 6:21
Sorry, docs are probably not that good in such a regard.
Starting from version 0.8.1, merging has been improved and has now a new HTTP
path and syntax.
Here's how your example would look like (provided you want to merge/add a new
key/value):
POST /myBucket/myKey/merge
{"+" : {"value2" : "merged"}}
If you want to replace "value2", just do the following:
POST /myBucket/myKey/merge
{"*" : {"value2" : "merged"}}
Original comment by sergio.b...@gmail.com
on 5 Apr 2011 at 7:04
Got it. Thanks for your help.
I tried it and our merge usage works again with the newest version.
But one last thing....
Wouldn't it be useful to combine the + and * fields and/to create another one.
Something like "+*" ....
The "+*" field contains an object with fields/values to add OR to
replace/update an existing one
Right now, you have to know the value of your bucket/key to select the right
field (+ or *), or you have to make a "GET" first, check for exists, select the
right field. Up to 3 steps for a single merge...
But what if just want to take care that my bucket/key got another OR updated
value....regardless if it exist or not.
Original comment by schultem...@gmail.com
on 5 Apr 2011 at 10:42
Thanks for your feedback: do you mind opening a new issue about your
improvement request?
Original comment by sergio.b...@gmail.com
on 26 Apr 2011 at 9:50
Original issue reported on code.google.com by
schultem...@gmail.com
on 4 Apr 2011 at 9:54