我的火力點設置節點的孩子是這樣:如何提取數據快照
Parent_node:{
Type:{
1476663471800:{ //This is a timestamp = Int64(date.timeIntervalSince1970 * 1000.0)
uid: USERS_UID;
}
}
}
我怎麼會訪問用戶的uid?我曾嘗試下面的代碼,但它不是提取UID
self.databaseRef.child("Parent_node/\(Type)").queryLimitedToLast(5).observeEventType(.Value, withBlock: { (snapshot) in
print(snapshot)
if let userDict = snapshot.value as? [String:AnyObject]{
for each in userDict{
let uidExtraced = each
print(uidExtraced)
//("1476663471700", [uid: USERS_UID])
你想'USERS_UID'? ??? –
你好!是的,我試圖提取USERS_ID :( – gk103
我收到一個錯誤:類型'(String,AnyObject)'沒有下標成員 – gk103