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

142
Vistas
Multi type user authentication in nodejs and mongodb

I want to develop a multi-vendor e-commerce backend. It has 4 types of users.

  1. Customer
  2. vendor
  3. staff
  4. admin

If I use a collection model and user_type to handle 4types of users then a staff/vendor will not able to register as a customer. If I use different collection models for different types of users then there will be too many routes. I need to develop login, register, update, getOne, getAll routes for each type of user.

So, which is the best way to design a collection for multi-type users and manage routes in efficient way.

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

0

You can manage in same collection like email with user_type, if email already registered as staff or vender(user_type like staff/vendor) restrict user to register as a customer. You can easily manage using email with user_type check.

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