2
我想爲一個顯示公司列表的應用程序構建適當的結構。當我點擊一家公司時,該應用會在其他視圖中顯示電話號碼。有人可以用我的結構來提醒我嗎?我的Firebase數據庫結構。這是正確的層次?
{
"companies" : {
"c1" : {
"name" : "Secure Home LLP",
"subject" : "Security"
}
},
"phones" : {
"c1" : {
"p1" : {
"name" : "Check point",
"phone" : "201-478-4600"
},
"p2" : {
"name" : "Dispatcher",
"phone" : "201-478-4678"
}
}
}
}
是啊!但重點在於,公司可能有幾個電話號碼。因此,它使得深層次。至少在一個級別上。我閱讀了Firebase的db結構示例,並找到了類似的例子。 https://firebase.google.com/docs/database/android/structure-data#avoid_nesting_data –