Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore pricing related to collectionReferences

How many reads are counted for the following query?

fireClient.Collections(ctx).GetAll()

will the following query result in 1 read or will it depend on the number of subcollections?

fireclient.Collection("users").Doc("user_id").Collections(ctx).GetAll()

I am trying to list down the subcollections within a document. I want to know the pricing for the same?

Edit: Get All function - go docs

like image 224
Ghost Avatar asked Jan 22 '26 13:01

Ghost


1 Answers

When you call GetAll() in this line:

fireClient.Collections(ctx).GetAll()

You will get all root collections and when you call GetAll() in this line:

fireclient.Collection("users").Doc("user_id").Collections(ctx).GetAll()

You'll get all sub-collections of the user_id document.

In both situations, you'll get an array of collection references. This means that you only read the names of the collections and not the actual documents within them. So since you aren't reading any documents, there is nothing you should pay. That's the reason why you cannot find anything related to this in the pricing section.

like image 61
Alex Mamo Avatar answered Jan 25 '26 09:01

Alex Mamo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!