Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this should work for a belongsToMany relationship where DriverCar is the join table
- Driver.findOne({
- where: {id: 10},
- include: [{
- model: Car
- }]
- })
- // this should work where Driver hasMany DriverCar and Car hasMany DriverCar
- Driver.findOne({
- where: {id: 10},
- include: [{
- model: DriverCar,
- include: [{
- model: Car
- }]
- }]
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement