Advanced Queries Firebase


#1

Hey !

This is my database structure :

I would like to recover 20 user who have “totalRecu” equal to “3” !
The purpose of this request is learn firebase queries.

My try :

    var ref = firebase.database().ref('/user').orderByChild("totalRecu").on('child_added', shot => {
      shot.ref.equalTo(3).on('value', shot2 => {
        console.log(shot2.val())
      })

My console.log():
Capture2