Is possible to have repeated document IDs in the same collection group but in different parents?
Ex.
Collecctions:
- Collection
user
- Collection group
whishlist
under collection called
Documents:
- Doc1 =>
user/USER_ID_1/whishlist/DEFAULT_LIST
- Doc2 =>
user/USER_ID_2/whishlist/DEFAULT_LIST
2
Answers
Yes, it’s possible. You should be able to try this easily for yourself by creating such documents in the console.
According to the official documentation regarding the document IDs:
So the IDs of the documents in Firestore should be unique within the same collection but since you’re asking about a collection group (different collections or sub-collections), then yes, you can have documents with the same IDs.