link with out changing data

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

link with out changing data

Venki Yedidha
Hi All,
           I am using links to store my data.
           I will insert data regarding my country first and then I will link this country to cities when each city object is inserted.
           However, It is not allowing me to link this country to cities with out changing data of the country.
      

            So,
                    I want to insert Country data first, whenever a city enters we should link this country to city with out changing the country data.
                Please help me on this.

Thanks,
Venkatesh.Y

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: link with out changing data

bryan-basho
Administrator
On Tue, Jun 26, 2012 at 2:43 AM, Venki Yedidha
<[hidden email]> wrote:
>                     I want to insert Country data first, whenever a city
> enters we should link this country to city with out changing the country
> data.

Hi, Venkatesh. As you have noticed, Riak does not support
partial-update operations. You must write the entire value of the
object every time. Most client libraries should make this easy for
you, by automatically remembering the value you read, and re-writing
it without change if you only modify some metadata (like links).

But, if keeping the country data off the wire during a link-changing
operation is your goal, my advice would be to use two objects: one for
your country data, and one for its links. This way you can change the
links object without touching the data object.

HTH,
Bryan

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com