Creating nested documents in firestore
- Firestore returning no records yet, I see them in console
- Collection not retuning any element.
- ... ...
You might facing issues written above. Then it might be this case.
You might getting empty response in this kind of query though there are elements in firestore.
I face the same problem. Though data was stored sucessfully ( I was guessing, which was wrong actully ). To verify that your data is not stored as you expceted you can do check this.
|Key in italics font means element is deleted|
If key of your data is in italic font then your data is not stored or is marked as deleted [ that was happening in my case ]. See in image.
Now you might thinking, that I have created element and not deleted it then why it's showing as deleted.
Truth is that if you want to create nested
- collection ( parent collection )
- document ( parent docuemnt )
- collection ( child collection )
- document ( child document )
you have to create first parent document and after using its referance you have to create child document.
You should find reson behind this behaviour your self , but for now, perfect way to handle this would be is make sure you code creating documents at every level explicitly.