VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. How query the Firebase Firestore in Angular
Programming Blog

Atom/RSS Feed

angular/firebase

How query the Firebase Firestore in Angular

angular/firebase

To query the firebase firestore in angular you can do the following

First import the firestore

import { AngularFirestore, DocumentChangeAction } from '@angular/fire/firestore';

Constructor

constructor(
       db: AngularFirestore // inject the firestore
   ) {
       db
           .collection('some-collection/') // reference the collection
           .snapshotChanges()
           .subscribe((myDocuments) => console.log(myDocuments.payload.doc.data()));
   }
Join my mailing list