那么,根据文档,这个答案https://stackoverflow.com/a/46639620/2873357,集合和文档应该齐射。Firebase Firestore:如何构造数据
我需要保存数据以这种方式构造:
"app" :{
"users" :{
"$uid" :{
"notifications":{
"auto-gen-id" :{
"notif-object":{
"type":"",
"subType" : ""
}
}
}
}
}
}
所以,我理解这一点,这就是,
: "app (collections)/
users (document)/
$uid (collections)/
notifications (document)/
auto-gen-id (collections)/
"notif-object" (document)/
type (field),
subType (field)
我似乎无法达到这种事在Firebase控制台中。
喜尽量扁平化火力结构,为通知创建单独的节点,在用户ID存储用户的通知...如果你使用嵌套一个,它将需要一些时间来获取数据 – Shanmugam
@Shanmugam请忽略时间,我仍然需要完全按照我的要求。 – Relm
你得到什么问题,你的要求是什么 – Shanmugam