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

182
Views
Delete file on realtime Database on Firebase with React.js

This is the database link

const firebase = "https://booktakeaway-dd150-default-rtdb.europe-west1.firebasedatabase.app"

And this the function that i use to delete the file, but i doesn't work. I can't find anything online.

return async dispatch => {
    try {
      const response = await firebase.get(`booksData.json?auth=${token}`);
      const firebaseData= response.data;
      for (let key in dataFirebase) {
        if (id === firebaseData[key].bookId) {
          await firebase.ref(`/booksData/${key}`).remove();
          console.log("Done");
        }
      }
      await dispatch(getSavedBooksIDs());
    } catch (error) {
      console.log(error);
    }
  };

Structure of the databse

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

0

You can try to set it to null, worked for me:

return async dispatch => {
    try {
      const response = await firebase.get(`booksData.json?auth=${token}`);
      const firebaseData= response.data;
      for (let key in firebaseData) {
        if (id === firebaseData[key].bookId) {
          await firebase.ref(`booksData/${key}`).set(null);
          console.log("Done");
        }
      }
      await dispatch(getSavedBooksIDs());
    } catch (error) {
      console.log(error);
    }
  }; 
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!