I have this db structure:
Firestore-root
|
--- sites (collection)
| |
| --- common (document)
| |
| --- //templates (collection)
| |
| --- //menus (collection)
| |
| --- //articles (collection) <----
| --- other (document)
| |
| --- //articles (collection)
When I try to add articles to the db (shown by the arrow) the "common" and the "other" - document is in italic and therefore doesn't exist.
My code when i try to add: priority is common, type is articles.
def documentReference = firestoreClient.databaseReference.collection(siteName).document(priority).collection(TYPE).document(key)
documentReference.set(article)
this is the console:
Is this a bad way to structure my db or is there a quick fix?
I have tried to create the sub collections first but without any luck!