Friday 5 May 2017

Search Value Firebase Node.js

I am trying to access a key with unknown parent as :

var ref = admin.database().ref("user_contacts/{pushId}").child(event.data.ref.parent.key);
              ref.once("value", function(querySnapshot) {
                      var qVal = querySnapshot.val();
                console.log("Querry Value:", qVal);
       });

snapshot always return null, data exsits againsts this key under multiple.

{pushId} //push ids are unknown here.

Is there any else way to achieve this? Or any body here can suggest me an improvement in my method? I am just trying to search a key in db.



via Saira Nawaz

No comments:

Post a Comment