admin管理员组文章数量:1192929
This is my Firebase Database:
I need the URLs of the images that are associated alongside the unique random name generated by the push method. Is there any way I could do that? Also, there must exist a better way of sending data. Please, let me know. Thanks.
imgRef.on('value', function(snapshot) {
console.log(snapshot.val());
});
This is, as expected, returning the entire JSON object. I need the URL.
This is my Firebase Database:
I need the URLs of the images that are associated alongside the unique random name generated by the push method. Is there any way I could do that? Also, there must exist a better way of sending data. Please, let me know. Thanks.
imgRef.on('value', function(snapshot) {
console.log(snapshot.val());
});
This is, as expected, returning the entire JSON object. I need the URL.
Share Improve this question edited Dec 23, 2016 at 1:44 AL. 37.8k10 gold badges145 silver badges284 bronze badges asked Dec 22, 2016 at 21:34 Somanshu SrivastavaSomanshu Srivastava 1712 gold badges2 silver badges6 bronze badges1 Answer
Reset to default 27This is the most basic way to show the list of image URLs:
var rootRef = firebase.database.ref();
var urlRef = rootRef.child("user1/DAA Notes/URL");
urlRef.once("value", function(snapshot) {
snapshot.forEach(function(child) {
console.log(child.key+": "+child.val());
});
});
本文标签: How to get the value of children in Firebase JavascriptStack Overflow
版权声明:本文标题:How to get the value of children in Firebase Javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738383033a2084044.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论