I need some guidance in structuring part of my Firebase database. I am familiarising myself with NOSQL dbs and it sometimes feels like I am doing the wrong thing.
I have a main node called Post where I store my blog posts.
I am implementing comments and for that I created another main node(object) named Comment. Each comment has its own unique id user details and the comment itself.
To tie it with the posts, I added under the each post a node called Comment where I store the Unique ID of the comment created in the Comment object.
The problem is when I want to read all the comments from a post I need to make individual requests to Firebase with each Comment unique ID and it does not seem right to me.
What would be the best way to design this structure in order to optimise reading? And how would the query syntax be for a case like this?
This is an iOS Swift project.