Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda