[英]React-Native Real-Time Firebase How to find all child components(all references)?
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.我想输入一个数据库链接并获取所有引用。在 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
https://firebase.google.com/docs/reference/node/firebase.database.DataSnapshot
you can do like this:-你可以这样做:-
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child("Frist Child").child("Second Child");
I wrote "/" to ref and I got all the things.我给 ref 写了“/”,我得到了所有的东西。
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 ); });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.