Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

getting a doc read count of a sub collection in firebase?

I am trying to change the structure of part of my Db, it a part that is getting called pretty frequently, thus I am afraid it is going to cost more than one read per call due to my new nesting nature, I want to nest it under a sub doc due so I can protect the whole sub-col by a premium Until value, will this nesting increase the price of since I am querying deep to 1 level plus checking the premium Until value in rules ? would my single call now considered a double call one for the week and one for the weeks ??

// Call

    let collectionRef = collection(db, 'Weeks', id, 'week');
    // get a specific doc in that sub-collection.

// Db Model

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Top Lvl
enter image description here

>Solution :

The nesting of a document doesn’t affect how much it costs to read it. One document read is always going to cost the same, no matter what the collection it comes from.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading