Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
Node.js sequelize 3 models with 1 pivot

I am trying to create my models and relationships for a Node.js application with a MySQL database. My models are the following:

User, Area, Level

I want the level a user has on a specific area. So the relations should be something like this. So all of them are in a many-to-many relationship with each other.

User.hasMany(Area)

User.hasMany(Level)

Area.hasMany(Level)

Area.hasMany(User)

Level.hasMany(User)

Level.hasMany(Area)

Do want to connect them throught one pivot table i.e. area_employee_levels that will include user_id, area_id, level_id. Is there any way to do this with sequelize? And then how to get select the user with all the relationships?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you need to read this part of the documentation for Sequelize. It will help you on you issue

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda