I'm working on a project that uses Datastore to keep data of in-game events for machine learning. I hope I'm able to update the indexes.yaml file on production mode by API calling or some other methods, instead of running gcloud SDK commands manualy. Is there any way to reach this purpose?
[Architecture]
[My Current Approach]
But the indexes are not updating on the production Datastore, I have to append the indexes on emulator then update it to production by
gcloud datastore indexes create
command (though it makes sense as the official documents only mentioned this approach)
[What I need]
Because we may have many new games go online in the coming months, so it will be hard to add then update indexes for these new games one by one. Is there any way to automatically update the indexes.yaml on production Datastore?
My appreciates for giving any suggestion or reference resources!
Your current approach only works in DataStore emulator. It is intended behavior. So you can identify your indexes and then deploy them to production database.
Cloud Firestore in Datastore and Firestore native modes creates automatically only single indexes and not composite indexes.
However, using Firestore (Datastore in Firestore mode) it is possible to identify what indexes you are lacking using error message.
As a workaround (also for Firestore mode) you can: