f-miyu / Plugin.CloudFirestore

MIT License
123 stars 44 forks source link

Question about IDocumentReference data type #77

Open akuteru opened 3 years ago

akuteru commented 3 years ago

I would like to ask how this thing works? Does this work like a join query in SQL?

Here is my scenario.

I have a Feed class which contains Title, Body, PostedBy

PostedBy is a DocumentReference type for my Users collections which contains user basic information (display name, birthdate and etc.)

What I want to achieve is upon calling the collection "Feed" I want it to also return the Name of the user on that same fetch. Is DocumentReference type the correct way to approach this? If so can someone enlighten me as to how to?

I just don't know how to work this out.

Can someone guide me or help me on this case? Will be much appreciated.

f-miyu commented 3 years ago

Firestore doesn't support join query. You need to get each user document with the DocumentReference.