We're trying to run a script on could-shell to create a new firestore collection in native mode.
However it creates it in datastore default mode.
What should be change in our flags? --type=firestore-native
Code:
create_firestore() {
DB_EXISTS=$(gcloud firestore databases list --filter="name=projects/'$PROJECT_ID'/databases/'$DB_NAME'" --format="get(name)")
if [[ ! -n $DB_EXISTS ]]; then
echo -e "\n${COLOR}Creating Firestore...${NC}"
gcloud firestore databases create \
--database=$DB_NAME \
--location=$DB_REGION \
--type=firestore-native
else
echo -e "\n${COLOR}Firestore exists.${NC}"
fi
}
I saw we can switch modes when the DB is empty. And this also shows we're using the right flag then.
firestore in native mode
using command `gcloud firestore databases create --location=us-east1 --type=firestore-native`. Can you check if you are using latest version of `gcloud`?