Firebase Firestore Tutorial #3 - Getting Documents
Why Stack Overflow recommends it
Stack Overflow users link it when answering or following along with questions about reading Firestore documents and displaying them on a web page.
Recommended by 3 people across 3 different months, 2018 to 2021.
What it is
Part 3 of Net Ninja's Firebase Firestore tutorial series, showing how to fetch documents from a Firestore collection with the JavaScript SDK and render the results as HTML elements in the browser. Presented by Shaun Pelling in a short screencast format with course files on GitHub.
What people said
Recommends Kolban · 2019-11 · Stack Overflow · on “How to make doc.id clickable item?”
I believe what you are looking for is a design/logic to list documents in a firestore collection in your browser and make them list items. You then want to click on an item and have the content for that document displayed to the user. This will require programming logic on your end. You will want to write browser/client side JavaScript that is called when a link is clicked (onclick). When the JavaScript code is reached you will then want to make a web client call to the Firestore database to retrieve the corresponding document. See: [LINK] This looks very useful too: Firebase Firestore Tutorial #3 - Getting Documents [this video]
Recommends Al-76 · 2020-04 · Stack Overflow · on “How do I retrieve a URL stored in a Firebase database and then populate an image tag's src?”
I have followed a good tutorial on how to create a Firebase database. ( [this video] ) Then I have managed to retrieved this data to show on my webpage. Working with text and numbers is clear but what happens when I want to render an image on my HTML page? Images are served from on my site. Therefore, I can use a text field to store the URL of an image but how would I then show this on my page as the tag is created but obvisously not the 'src' to populate the URL. Any help welcome. const productList = document.querySelector('#productList'); function renderProducts(doc) { let li = document.createElement('li'); let title = document.createElement('span'); let price = document.createElement('span');
Recommends Andres Fiesco Casasola · 2021-12 · Stack Overflow · on “Firestore data returns undefined after reading it from database in javascript”
Apparently, the data is not being correctly retrieved from Firestore, it seems something is missing. What documentation are you using to create the code? Please share any documentation or tutorial you are following, as well as the exact error your console throws when you run the code. Here is a very useful video [this video] about getting data from Firebase.
Cites Nilesh Sutar · 2018-06 · Stack Overflow · on “Javascript firestore:how to get results of a where query”
You may try this... var Cloud = firebase.firestore() var data-id; var groupRef = Cloud.collection("Groups").get().then((snapshot)=>{ snapshot.docs.forEach(doc =>{ data-id = doc.id })}) var query = groupRef.where("Name", "==", "Python").get() alert(query) Or you can refer this link [this video]
Cites Syntax Hacker · 2018-07 · Stack Overflow · on “firebase.fireStore() is not a function”
Just Started learning firebase using this youtube [this video] tutorial and i'm stuck with initialing database .These are firebase script tags placed above initialization. <script src=" [LINK] "></script> <script src=" [LINK] "></script> and here's my initialization script <script> // Initialize Firebase var config = { apiKey: "something", authDomain: "something", databaseURL: "something", projectId: "something", storageBucket: "something", messagingSenderId: "something" }; firebase.initializeApp(config); const db = firebase.fireStore(); db.settings({ timestampsInSnapshots: true }); </script> even this didn't work <script src=" [LINK] "></script> and this is the error i got when i console.log(db)
Cites setted · 2020-01 · Stack Overflow · on “Firestore/Javascript: Uncaught (in promise) TypeError: Failed to execute 'appendChild' on 'Node': 1 argument required, but only 0 present”
I am currently following this tutorial [this video] and followed it exactly but tweaked it to my coding style. What I want to happen is to display certain fields of a uid in a firestore sub-collection named patients to my web page. But I keep getting the error Uncaught (in promise) TypeError: Failed to execute 'appendChild' on 'Node': 1 argument required, but only 0 present Which is a completely contradicts the expected output shown on the tutorial. Here is my code: <div class="card"> <div class="card-body text-center"> <div class="card-body text-left"> <script> firebase.auth().onAuthStateChanged(user => { if(user){ this.userId = user.uid; } //stores the user id in variable const patientNames = d