skip to Main Content

Mongodb – mongo query for a one-to-many collection where all records has to match the condition and get an unique record

Employee has multiple employeeActions, the employeeActions data looks like this: [ { "email": "[email protected]", "companyRegNo": 105, "event": { "created": ISODate("2022-09-16T06:42:04.387Z"), "desc": "COMPLETED_APPLICATIONS", "note": "Direct apply" } }, { "email": "[email protected]", "companyRegNo": 105, "event": { "created": ISODate("2022-09-20T06:42:42.761Z"), "desc": "ASKED_TO_REVIEW", } },…

VIEW QUESTION

Mongodb aggregation response

I have a Property controller : //Get Properties By Type const getPropertiesByType = async (req: Request, res: Response) => { const { cities, type } = req.query const citiesArr = typeof cities === 'string' ? cities.split(',') : [] try {…

VIEW QUESTION
Back To Top
Search