2017-01-09 59 views
1

我有一個火力點數據結構設置以下方式如何搜索Firebase DB的特定值?

volunteers 
-Ka3oeRZ-RhhJ-Iw5CmE 
    address: '17 McGovern Lane', 
    email: '[email protected]' 
-Ka3oeRZ-RhhJ-Dkxc43 
    address: '9 Palace Drive', 
    email: '[email protected]' 
-Ka3oeRZ-RhhJ-Acda2 
    address: '10 Happy Lane', 
    email: '[email protected]' 

有沒有一種方法來查詢所有這些檢查特定的電子郵件?我試圖弄清楚不同的選擇,但有點困惑的是什麼命令。

+1

這個答案應該幫助你:http://stackoverflow.com/questions/14963776/get-users-by-name-property-using-firebase?rq = 1 – imjared

回答

3

您可以使用火力地堡查詢:

var query = firebase.database().ref().child('volunteers').orderByChild('email').equalTo(email); // the var email is the email you're looking for