を与えFirebaseデータを取得し、私はFirebaseと私のデータベースを使用しています以下のようになります。私は、たとえば電子メールを取得することができ、スウィフト3を使用して表示名を指定した方法は、特定のフィールドに
Users
user1
email: "[email protected]"
password: "pass1"
display name: "Name1"
user2
email: "[email protected]"
password: "pass2"
display name: "Name2"
? (私はName1
を知っていれば、例えば、取得されたデータは[email protected]
になります。)は、次のヘルパー関数の実装
let dbstrPath : String! = "Users/user1"
self.dbRef.child(dbstrPath).observeSingleEvent(of: .value, with: { (snapshot) in
if snapshot.exists(){
print(snapshot.value!)
// Here you got user value in dict
}
})
関連:https://stackoverflow.com/questions/43971814/firebase-querying-for-unique- username-swift –
私は表示名を見つけたすべてのデータを取得する方法を理解していますが、電子メールで正確なフィールドに到達する方法はわかりません。私は "snapshot.value"以外に何を書く必要があるのですか? @NiravD – alecs09
@begood私の答えがあなたの後ろのものであるかどうかを確認してください... –