Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UserProject = sequelize.define('user_project', { role: Sequelize.STRING});
- User.belongsToMany(Project, { through: UserProject });
- User.findAll({
- include: {
- required: true,
- through: {
- attributes: [],
- model: UserProject
- },
- model:Project,
- order: [[{ model: UserProject}, "role", "ASC"]]
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement