0
{ 
    "OrnekUserId": { 
    "AccessToken": "asd", 
    "CreatedAt": "2017/12/10", 
    "DeletedAt": -1, 
    "Email": "[email protected]", 
    "FirstName": "deneme", 
    "LastName": "denemeSoyad", 
    "LoginType": 0, 
    "Phone": "", 
    "ThumbNailUrl": "", 
    "UpdatedAt": -1, 
    "UserName": "denemeName" 
    } 
} 

enter image description here중포 기지는 스냅 샷에서 일부 데이터를 얻을 수

나는이있어 마침내 이메일을 검색이 JSON 데이터를 얻을 수 있지만, '알리'를 참조 서로 문제가이 항상 내 사용자 ID 컬럼과입니다 모든 사람을위한 변화.

사용자 이름과 사용자 ID ('ali') 열 값을 가져 오려고하지만이를 수행 할 수 없습니다. "asdada"와 "알리"

나는 그것을 어떻게 수행 할 수 있습니다 여기에

마지막 다른 내가 "사용자 이름"을받을 필요 상태에 내 코드

exports.ForgotPassword = functions.https.onRequest((req,res) => { 
    const email = req.query.Email; 
    if (email == "" || email == null) { 
     return res.json({ 
      result: "E-mail can not be null" 
     }) 
    } else { 
     const ref = admin.database().ref('Users').orderByChild('Email').equalTo(email).once('value', snapshot => { 
      if (snapshot.val() == null) { 
       return res.json({ 
        response: false 
       }) 
      } else { 
       return res.json({ 
        response: snapshot.val() 
       }) 

      } 
     }) 
    } 
}) 

입니까?

답변

0

나는 확실하지 않다 그러나 그의 그 결과 제공 할 수 있습니다 :

exports.ForgotPassword = functions.https.onRequest((req,res) => { 
    const email = req.query.Email; 
    if (email == "" || email == null) { 
     return res.json({ 
      result: "E-mail can not be null" 
     }) 
    } else { 
     return admin.database().ref('Users').orderByChild('Email').equalTo(email).once('value', snapshot => { 
      if (snapshot.exists()) { 
       return res.send(snapshot.val()); 
      } 
     }) 
    } 
}) 
+0

아비 문제 스와 벤 örnek JSON daki VERI gibi 그녀의 kullanıcıyı id'si altında tutmaya çalışıyorum şimdi mesela emaile 고어 아 라마 yapıp kullanıcı 놈 dönüyor AMA 스냅 샷 üzerinden을 kullanıcının bilgilerine ulaşamıyorum mesela diyelim kullanıcının idsi 5 şöyle yaparsam ulaşırım snapshot.val(). 5.UserName AMA ISTE problemde TAM 부르다 벤 oraya 5 yazamam 그녀 kullanıcının farklı id'si VAR nolur yardım 등 4 SAAT oldu 할라 çözüm bulamadım :( –

+0

칼럼니스트는 'snapshot.key'라고 불렀다. Yaramazsa daha açık yazar 산 yardımcı olmaya çalışacağım. – HakanC

+0

ABI snapshot.key koydum AMA sadece 사용자 yazıyor –