Greetings! I have come across the following code block that utilizes Angular Fire 2 to retrieve data from Cloud Firestore. While the code works well, I quickly exceeded my daily quota of 50,000 reads due to regular usage and testing.
I am curious to know whether if the result set returns a list of 200 items, Firestore counts this as 1 read or 200 reads (considering it is only one query in the code).
Furthermore, according to their quota and limits documentation, if any data in the list is modified, it is counted as an additional read. Is this applicable to all returned records or each individual record? Does this rule still apply when utilizing take(1)
?
menuCol: AngularFirestoreCollection<Menu>;
menues: any;
constructor(private afs: AngularFirestore, private router : Router) { }
ngOnInit() {
this.menuCol = this.afs.collection('MenuItems');
this.menues = this.menuCol.snapshotChanges().take(1)
.map(actions => {
return actions.map(a => {
const data = a.payload.doc.data();
const id = a.payload.doc.id;
return { id, data };
});
});
}