Home > OS >  Should I put a array as individual documents or one document?
Should I put a array as individual documents or one document?

Time:11-24

I have a list of URLs that are linked to the user. Currently, once the user adds those URLs to the app, I'm saving each URL as an individual document and then reading any document that matches their UID.

Is this the right way to do it?

And With Firebase, is it cost per read per document or read per item no matter if there are 100 items in one document?

Just trying to wrap my head around it so any help would be great!

CodePudding user response:

In my opinion you should save URL's in an array for every user. Because firebase charges you for one document read for each batch of up to 1000 index entries matched by the query. Check this link for more details:

  • Related