I am using Firestore (I am new to this) for small web application. Currently, each time when I refresh or go to another page, the function retrieves all the documents in the Firestore. But the data that it retrieves does not change often,
Is there a way for me to retrieve all the data that will cost me little to no document reads?
I am currently using these function to retrieve the data
firebase
.firestore()
.collection("products")
.then((snapshot) => {
snapshot.forEach((docs) => {
});
});
firebase
.firestore()
.collection("products")
.where("prodID", "==", prodID)
.then((snapshot) => {
snapshot.forEach((docs) => {
});
});