问题
I am confused about Cloud firestore cost. I want to get the size of a collection of 1000 docs, and I am not reading every doc data, so will it cost me as 1000 read or 1 read?
db.collection(`users/${user}/followers`)
.get().catch(onErr).then(followers=> {
console.log('followers length: ', followers.size);
});
I have 1000 docs in followers
collection, so as you can see I am only reading the length of collection, so how much will cost me ?? 1000 read or 1 read?
回答1:
If in the followers
collection you have 1000 document then it will cost you 1000 reads. Here you are attaching the method get()
which retrieves all the documents in a collections
来源:https://stackoverflow.com/questions/61367032/will-cost-only-getting-the-size-of-a-collection-of-1000-docs-as-1000-read