Firebase query filter(equalTo) in Node

20 views
Skip to first unread message

hitech....@gmail.com

unread,
Sep 20, 2017, 10:09:59 AM9/20/17
to Firebase Google Group
I need problem in querying for equalTo 

var modellist =admin.database().ref("computer_model");

 modellist.orderByChild("Model number").equalTo("ABC").on('child_added', function(snapshot) {
         var val =snapshot.val().Des;
         
        
    });

I am getting blank in response ,even i have data entry in DB for ABC in Model number

Please suggest.

Tarik Huber

unread,
Sep 20, 2017, 3:09:28 PM9/20/17
to Firebase Google Group
Did you try to use the "once" call:
[your query].once('value', snap=>{ ...your code...})
?

Kato Richardson

unread,
Sep 21, 2017, 2:53:04 AM9/21/17
to Firebase Google Group

First things first, you aren’t capturing any errors or logging anything in your success callback. Most likely, an error is occurring.

Try something like:

modellist....on('child_added', snapshot => console.log(snapshot.key), error => console.error(error));

If that’s not getting invoked, then you’ll need to include a more complete repro of the problem.


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/6c24c3b2-e383-41d2-ac2a-0a91d0f56ff8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages