[英]Retrieve nested data from firebase using Swift
我如何訪問嵌套的網站 url。 我也不知道如何訪問 Medium 部分下的 img。 我可以通過提供的圖像中的代碼訪問其他信息,沒有問題:
ref = Database.database().reference()
ref.child("artists").queryOrderedByKey().observe(.value) { snapshot in
var temp = [Artist]()
for child in snapshot.children {
if let child = child as? DataSnapshot {
// decode json into Artist Struct
let model = try! FirestoreDecoder().decode(Artist.self, from: child.value as! [String : Any])
temp.append(model)
// print(model)
}
}
Let ref = Database().database.refrence()
ref.child("TopNode").child("secondInerNode").observe(.value, with: {//stuff})
你寫下你有數據的地方的路徑,然后觀察。
TopNode
secondInerNode
name: value;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.