When I access to the Cloud Datastore web management, there are no indexes listed under the "Indexes" section and I would like to define explicitly some indexes in order to run advanced queries. I have a yaml file that looks like:
indexes:
- kind: order
ancestor: no
properties:
- name: email
- name: name
- name: ownerId
- name: status
- name: updated_at
- name: created_at
direction: desc
And I run the following command to create the indexes:
gcloud preview datastore create-indexes indexes.yaml
and this is the error message that I'm getting:
"Unexpected attribute 'indexes' for object of type AppInfoExternal"
Has anybody come across the same issue? Any ideas?
Regards, Jose
Unfortunately the create-indexes
command is a little brittle: it requires that the index.yaml
file that you provide is named index.yaml
and not indexes.yaml
. Otherwise, it will try and parse it as a different type of configuration.
Try renaming your index file to index.yaml
then calling the command again.
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