Search code examples
javascriptgoogle-cloud-firestoreangularfire2

how to call data from collection


enter image description here

this code I call the collection but I want call all data from the collection

export class RepairService {
    Reqref: AngularFirestoreCollection < ServiceRepair > ;
    constructor(private db: AngularFirestore, public ngFireAuth: AngularFireAuth) {
        this.Reqref = db.collection('iygR4pP0ZDXxBlFmzUMxAeqKtkt1', ref => ref.where("Title", "==", "Service & Repair"));
    }

Solution

  • To load all data from the collection, remove the query from the collection call:

    this.Reqref = db.collection('iygR4pP0ZDXxBlFmzUMxAeqKtkt1');
    

    Or:

    this.Reqref = db.collection('iygR4pP0ZDXxBlFmzUMxAeqKtkt1', ref => ref);