I'm trying to obtain all objects that have an especific object in a collection. Example:
Object Company has a collection of Employees, and I want to find all Companies who have a especific Employee on this collection. What I'm trying to do is:
Company.find({where:{employees: {contains: employeeX}}}, function (err, companies) {
...
});
But it's not working.