Cloud Firestore wildcard for indexing

2020-06-23 02:10发布

问题:

What is the syntax for a wildcard level in Cloud Firestore when setting up indexing? I know there is one for security rules.

Thanks.

回答1:

Cloud Firestore indexes are based on collection names, not full collection paths. So if you want to create indexes on users/{id}/messages, the correct way to do this is to create an index on messages.

All same-named collections, even if nested under documents, share the same indexes.