How to find by subdocument
kaboume opened this issue · comments
Hi,
I have a collection of "stages" and each stage contains an adress as a subdocument.
I want to find all the stages that match with a specific region. So i wrote :
const filter = {}
if (req.query.region && req.query.region.length > 0) {
filter.adresse = { region: req.query.region };
}
const options = pick(req.query, ['sortBy', 'limit', 'page']);
const result = await stageService.queryStages(filter, options);
But this filter doesn't work.
Same issue
Any idea ?