I am using google cloud FireStore as a database for our e-commerce mobile application. I am a bit confused about the document read count for firestore documents when we retrieve documents from cloud firestore.
Location of firebase doc: users/123/ This doc contains users information like userId, userName, wishlist, cart, addresses and so. I have used multiple sub-maps to save all user data in a single document to reduce firestore billing costs. Structure of document :
userId:"123",
userName:"Sunil",
addresses : {
address1 : {
"doorNo":"123",
"city" : "Bengaluru"
},
address2 : {
"doorNo":"456",
"city" : "Bengaluru"
},
address3 : {
"doorNo":"789",
"city" : "Bengaluru"
},
wishlistItems:{
item1 : {
"itemId":"1"
},
item2 : {
"itemId":"2"
},
item3 : {
"itemId":"3"
},
item4 : {
"itemId":"4"
},
},
cartItems:{
cartItem1:{
"itemId":"1",
"itemCount":"2",
},
cartItem2:{
"itemId":"2",
"itemCount":"5",
},
cartItem3:{
"itemId":"3",
"itemCount":"7",
},
cartItem1:{
"itemId":"4",
"itemCount":"8",
},
},
},
I retrieve the document as follow: firestore().collection("users").doc("123").get();
My Questions : how many reads will be counted for each retrieval? Will it be only one as I am retrieving only a single document or will it be 12 (as the document is having 11 sub-maps and 1 as normal count)?
Please, help me get clear on this. Thanking you in advance.