Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
How can I display data from Firebase database?

In the application, you can add your bank to the Firebase database. When you click on the "Add Bank" button, the bank is saved to the database. I need to display cards with added banks on the screen. How can i do this? Now I am reading data from the database and it comes in the form of an object:

enter image description here

Code for read data:

const getBanksFunc = () => {
  const bankRef = ref(database, "banks/");
  onValue(bankRef, (snapshot) => {
    const data = snapshot.val();
  });
};

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Firebase's documentation covers this:

https://firebase.google.com/docs/database/web/read-and-write

import { getDatabase, ref, onValue} from "firebase/database";

const db = getDatabase();
const starCountRef = ref(db, 'posts/' + postId + '/starCount');
onValue(starCountRef, (snapshot) => {
  const data = snapshot.val();
  updateStarCount(postElement, data);
});

In your case, a for .. in loop could work:

for(let key in data) {
    const { bankName, interestRate, loanTerm, maximumLoan, minimumDownPayment } = data[key];
    ... do whatever you need
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!