skip to Main Content

I want to get all child components without writing anything.

I want to get all all references in a database link.

I want to enter a database link and get all references.In react-native.

I tried those funtions in the link below but couldn’t get them work. https://firebase.google.com/docs/reference/node/firebase.database.DataSnapshot

THANKS FOR ALL THE HELP <3
enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    I wrote "/" to ref and I got all the things.

          
          const firebaseMain = firebase
          .app()
          .database('https://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/')
          .ref('/');
          
          console.log("CHILDREN:");
          firebaseMain.ref.once('value', function(snapshot) {
            console.log(JSON.stringify(snapshot.val()));
            firebaseReferences=snapshot.val();
            console.log("x1b[32m","references: --> TYPE"+typeof firebaseReferences );
          });


  2. you can do like this :-

    DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child("Frist Child").child("Second Child");
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search