Scaffold an Explicit Document to Avoid Error When Creating Indexes in Google Cloud Datastore
When working with Google Cloud Datastore, I would like to design each kind (collection or table) with its own schema and index files:
But not every kind has to have something in the
index.yml file. So, what to do? Will the index creation command accept an empty
index.yml file with zero byte? Let’s give try:
No, it does not like it. Then, what’s the minimum required? The answer is an explicit document with an empty document content:
The three dashes form a directives end marker line. YAML uses three dashes to separate directives from document content.
When creating indexes with the file, it will proceed without errors or warnings:
Therefore, to avoid error, when scaffold an
index.yml file for indexing, use an explicit document with an empty document content.