In my firestore database, I use the same collection name in different parts of my hierarchy. For example, imagine a site like stackoverflow with the following 2 collections
/questions/{questionId}/votes/
/questions/{questionId}/answers/{answerId}/votes/
So now I want to create an index in one of these two collections. I would expect the firestore to require some kind of “wildcard” paths, as I used above to identify the data for indexing. However, instead they only need the name of the collection: in this case, “voices”.
So, if I put the index on the “votes”, is it applicable to both of these collections? Is there a way to put an index in one of these collections and not the other? Are unique collection names recommended to avoid this problem?
zevdg source
share