I'm working on e-commerce for my college project. I have a Parent collection of 'Products' and inside 'Products' collection I have documents of the different company name. Inside Company document I have created Collection of Categories likes vegetables, pastries etc.
I want to add the address key-value pair to the company name document. In a single query. To do this right now I'm using This query.
await firestoreInstance
.collection("Products")
.document(_productCompany.toUpperCase())
.setData({"data": ""}).then((value) => firestoreInstance
.collection("Products")
.document(_productCompany.toUpperCase())
.collection(_productCategory)
.document(_productCategory +
" " +
_productCompany +
" " +
_productName)
.setData({
"DownloadUrl": "$_downloadURL",
"CategoryName": "$_productCategory",
"CompanyName": "$_productCompany",
"ProductName": _productName,
"PricePerQuantity": _productPricePerQuantity,
"Available": true,
"itemQuantityToCart": 0
}));
Is there a way I can do It In a single query?