我有这个数据库结构:
Firestore-root
|
--- sites (collection)
| |
| --- common (document)
| |
| --- //templates (collection)
| |
| --- //menus (collection)
| |
| --- //articles (collection) <----
| --- other (document)
| |
| --- //articles (collection)
Run Code Online (Sandbox Code Playgroud)
当我尝试将文章添加到数据库(如箭头所示)时,“common”和“other” - 文档为斜体,因此不存在。
我尝试添加时的代码:优先级很常见,类型是文章。
def documentReference = firestoreClient.databaseReference.collection(siteName).document(priority).collection(TYPE).document(key)
documentReference.set(article)
Run Code Online (Sandbox Code Playgroud)
这是控制台:

这是构建我的数据库的糟糕方法还是有快速修复?
我曾尝试先创建子集合,但没有任何运气!