Query orderByChild in Firebase Realtime Database not working?

I've seen many posts and solutions that are precisely what I need but when I implement it it doesn't work. I'm using the Firebase Realtime Database and I'm trying to search all "Name" children for a specific name. In this example I added the strings directly, but I'll be using a variable based on user input in the future. Here is my database structure as I see it in firebase:

-NameOfDatabase
  -UserID
      -email:something@gmail.com
      -Name:someName
      -Color:someColor
  -NextUserID
      -email:somethingelse@gmail.com
etc....

And here is the code I'm using to query the "Name" (usersRef points to "firebase.database().ref()"). I've seen lots of examples of this online and I'm not sure what I'm doing incorrectly.

usersRef.orderByChild("Name").equalTo("Test Dummy").on("value", function(snapshot) {
    //This is where I expect to see Test Dummy on the console.  
    console.log(snapshot.val())
});

Thanks all in advance!



from Recent Questions - Stack Overflow https://ift.tt/2PxXape
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)