To define an index in firestore you can use, firestore.indexes.json
. Is there a way to define TTL properties in a similar way, so those are automatically deployed when switching environment (dev, staging, prod) ?
To define an index in firestore you can use, firestore.indexes.json
. Is there a way to define TTL properties in a similar way, so those are automatically deployed when switching environment (dev, staging, prod) ?
2
Answers
Although not documented it seems like it is possible to define TTL policies like this:
in firestore.indexes.json
Here is a PR adding the documentation in the repository readme
The Firebase CLI doesn’t support this, or at least not in a documented way. File a feature request on the firebase-tools GitHub to make your needs known for that.
You can use gcloud to set ttl policies programmatically instead.