I'm writing a script for setting up a Google Cloud project and I'd like to use Firestore. A new project, however, is by default in Datastore mode.
Switching to Firestore can easily be done using the web interface in the cloud console but I'd like to automate it. Is there any API or command line tool (gcloud? firebase?) for enabling it?
Firestore in Native mode Firestore is the next major version of Datastore and a re-branding of the product. Taking the best of Datastore and the Firebase Realtime Database, Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development.
For authentication, the Cloud Firestore REST API accepts either a Firebase Authentication ID token or a Google Identity OAuth 2.0 token. The token you provide affects your request's authorization: Use Firebase ID tokens to authenticate requests from your application's users.
Unfortunately, as of today (30 Apr 2019), there is no API or command line to set the mode for Cloud Firestore.
Things seem to have changed by now (03 Jan 2022). I managed to set up a new Firestore with gcloud using the following commands. Native mode is chosen by default:
gcloud app create --region=us-central
gcloud firestore databases create --region=us-central
also see the documentation for app create and firestore database create.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With