[Question] How i make a nested query? #263
Answered
by
wovalle
approached
asked this question in
Q&A
-
|
Hi@all I have a document/company with id 'Fire LLC'. But how i can query my members collection? I don't want first query my company collection and than the members collection. I have already my company id. My Example: const result = admin
.firestore()
.collection('companies')
.doc('Fire LLC')
.collection('members)
.get() |
Beta Was this translation helpful? Give feedback.
Answered by
wovalle
Jun 7, 2021
Replies: 1 comment
-
|
Hey! As of today, there is no way of preloading subcollections, so you'll have fetch the collection first. @Collection('companies')
class Company {}
const companyRepository = getRepository(Company);
const company = companyRepository.getById('Fire LLC');
const members = company.members.find() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wovalle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! As of today, there is no way of preloading subcollections, so you'll have fetch the collection first.