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.
CodePudding user response:
you can do like this :-
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child("Frist Child").child("Second Child");
CodePudding user response:
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 );
});