用于索引的Cloud Firestore通配符
问题描述:
设置索引时,Cloud Firestore中通配符级别的语法是什么?我知道有一个安全规则.
What is the syntax for a wildcard level in Cloud Firestore when setting up indexing? I know there is one for security rules.
谢谢.
答
Cloud Firestore索引基于集合名称,而不是完整的集合路径.因此,如果要在users/{id}/messages
上创建索引,正确的方法是在messages
上创建索引.
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.