Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

155
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda