Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. UserProject = sequelize.define('user_project', { role: Sequelize.STRING});
  2. User.belongsToMany(Project, { through: UserProject });
  3. User.findAll({
  4. include: {
  5. required: true,
  6. through: {
  7. attributes: [],
  8. model: UserProject
  9. },
  10. model:Project,
  11. order: [[{ model: UserProject}, "role", "ASC"]]
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement