Fiaz Ali
Fiaz Ali

Reputation: 143

Read Counts for Firebase Firestore list within document

I want to ask something about read counts of firebase.

Let's say i have a collection of posts and for every post-doc i have an array of the users ids. Basically storing the ids of every user which liked the current post.

Now, let's say i load the data of first 10 posts and every post-doc array field consists of 10,000 userIds : ['id1', 'id2' .........'id1000']

So my question here is that what should be the read count :

Basically, i am trying to implement a system of liking the posts. Every User can like post but the read count of firebase is somewhat unknown to me.

Any suggestions or help on firebase read counts or this topic?

Upvotes: 1

Views: 121

Answers (1)

Huthaifa Muayyad
Huthaifa Muayyad

Reputation: 12353

let's say i load the data of first 10 posts and every post-doc array field consists of 10,000 userIds : ['id1', 'id2' .........'id1000']

According to this, you will actually read 10 x documents, and therefor, you will be billed for 10 read requests.

If the document had 1 single field, or as your case, had a list, containing many children, it's still billed the same way => 1 document read.

Upvotes: 1

Related Questions