I'm using cloud firestore for the backend DB and since I'm not that familiar with it.. i'm a bit stuck on the following.
DB setup: Messages (collection) -> itemId (doc) -> itemMessages (collection) -> Message (doc) -> the message data with (message, xId, yId)
My question is.. how can I query all the itemMessages for itemId where xid = 1?
Or is there a better solution for the DB setup? I have checked the docs, but those didn't a 'sub' collection in the examples.
[Firebaser here] There is no way to query across subcollections, meaning if you wanted to find all of the itemMessages belonging to any "item" that match your query, you cannot do that.
You could query a specific subcollection like this:
The feature to query across subcollections is something we definitely want to do in the future but it will not come in the short term so if you need that right now I would suggest a different database structure.