Answers for "include with where clause in sequelize"

0

include with where clause in sequelize

Document.findAll({
where: {'$employee.manager.id$': id},
      include: [{
        model: models.Employee,
        required: true,
        as: 'employee',
        include: [{
          model: models.Manager,
          required: true,
          as: 'manager',
          where: { id: managerId },
        }],
      }],
Posted by: Guest on December-08-2020

Browse Popular Code Answers by Language