Vinayak Hebbar
Vinayak Hebbar

Reputation: 1

Firestore query : does query consume data without subscription?

Firestore query : I did not subscribed the query, just assigned query to variable, does it consume data without subscription?

 let query1 = this.angularFirestore.collection("Products");
   let query2 = this.angularFirestore.collection("Products", (ref) =>
        ref.limit(this.limitter).orderBy("Price", this.sort)
      );

Upvotes: 0

Views: 77

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599141

All calls in the snippet you share merely build the query, none of them actually reads from the database.

No data is read from Firestore until you subscribe to one of the queries in the snippet.

Upvotes: 4

Related Questions