Mongoose - query to get all subdocuments of a document Mongoose - query to get all subdocuments of a document mongoose mongoose

Mongoose - query to get all subdocuments of a document


Just populate company.users

Company.findOne({        'name': req.user.name    })      .populate('users', 'username name surname')      .exec(        function(err, company) {          if (err) res.status(500).send(err);          res.json(company.users);        });


matomo