Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change google cloud datastore kind name ?

We are using google cloud datastore to store data and unfortunately initially haven't followed name convention for naming kinds and now we want to change names of already existing kinds in datastore.

We have already accumulated a lot of data and a lot of computation was involved generating that data so populating that complete data again just to rename a kind isn't an option for us.

Have tried finding it out but with no luck. So is there something which I have missed and can be helpful in achieving it ?

like image 870
vinit payal Avatar asked Feb 16 '18 01:02

vinit payal


People also ask

What is Datastore kind?

An Entity is an individual record that gets stored and retrieved from the datastore. The Kind is the unique string identifier of the type of entity. For example, "Joe" is an Entity with age=42, dob=10-12-2000, and Kind "Person".

How do I update entity in Datastore?

To update an existing entity, modify the attributes of the Entity object, then pass it to the DatastoreService. put() method. The object data overwrites the existing entity. The entire object is sent to Datastore with every call to put() .


1 Answers

You cannot rename a kind in datastore, Because the kind name is embedded with the key of each element in the datastore. You will have to write a script to migrate all the data to the new kind.

like image 182
Akash Avatar answered Oct 04 '22 20:10

Akash