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

154
Views
Retrieve Firebase realtime database in Json form using Angular

I have used Google Script to send data from Google sheet to firebase realtime database. Here I am trying to retrieve those data in json form. My real time databse looks like: [![enter image description here][1]][1] my service.ts

getRealData():Observable<any>{
      return  this.afs.collection('draft-memorial-default-rtdb')
      .snapshotChanges().pipe(
      map(item => {
      return item.map(value => {
        const ref = value.payload.doc.data();
        console.log(ref);
        return {
        ref
        };
       
      });
    })
  );
}

Component:

ngOnInit() {
   this.auth.getRealData().subscribe(res=>console.log(res));
  }

I have done with other database but with realtime database how do we retrieve data if the data are stored from google sheet using google script? [1]: https://i.stack.imgur.com/D2Kfv.png

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

0

I found the solution : service.ts

getAll(): AngularFireList<any> {
      return this.tutorialsRef;
    }

component

ngOnInit() {
   this.getRealData();
  }
getRealData(): void {
  this.auth.getAll().snapshotChanges().pipe(
    map(changes =>
      changes.map(c =>
        ({ key: c.payload.key, ...c.payload.val() })
      )
    )
  ).subscribe(res => {
    this.data = res;
    console.log(res);
  });
}

It return the key value with they payload.

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!