Sequelize: left join multiple tables to support searching and ordering(1)
This is a basic case for one-to-one relationship using left join multiple tables. Let’s start from describing the use case in a scenario:
Say your Sales team has a contact database stored all the customers’ contact, and each contact has its owner who is a Sales agent in your team.
So when you look up the whole contact list,
- You would like to see the corresponding agent.
- You would also like to search those contacts based on an…