I'm using Firebase Cloud Firestore
, I want when I'm getting a document with reference field inside to receive the reference field as a document and not as a reference to the document...
I have a collection of users and collection of classes (at school) and each class contains a list of references to users (the students in this class).
When I using document.get()
(to get the class by its reference) it returns an object that contains a list of DocumentReference
(of the users) so I need to call document.get()
around 20 more times just to get the users as objects and not as a reference to them.
I want to be able to call document.get()
once and it will bring me all the references as documents, like that:
database and code
Is there an elegant way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…