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

118
Vistas
SEQUELIZE: I'm trying to seed data for a wish list table for a website I'm building

So basically using sequelize I created a user model, a product model, and a wishlist model. The wishlist needs to be seeded but I hypothetically want a user to be able to insert more than 1 item into a row. So if I have a column titled product_id I want to be able to put multiple products into that column. Here's the seed file for reference:

const { Wishlist } = require('../models');

const wishlistData = [
  {
    user_id: 1,
    bike_id: 4,
    part_id: 1
  }
];
const seedwishlist = () => Wishlist.bulkCreate(wishlistData);

module.exports = seedwishlist;

I thought that for the part_id column I can maybe have an array-like

part_id: [1,2,3]

But it gives me an error that it truncates and I can't seed the file.

Any suggestions on solving this problem?

about 4 years ago · Juan Pablo Isaza
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