我試圖查詢這個數據庫返回null火力地堡查詢數據庫的用戶名
databaseReference.child("users").queryOrdered(byChild: "username").queryEqual(toValue: "billsmith").observeSingleEvent(of: .value, with: { (snap) in
print(snap)
})
這行代碼返回空值 - 意義它沒有在用戶節點中找到「jondoe」作爲用戶名。我如何得到這個工作?
'byChild:「usernames」'應該是'byChild: 「username」'匹配數據庫 –
這是一個錯字 - 謝謝你的收穫! –