Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

881
Views
Secuela de error en DataTypes.ARRAY(DataTypes.STRING)

Soy nuevo en el desarrollo de NodeJs. Estoy usando NodeJs con mysql y Sequelize para crear un modelo por lotes con estas propiedades.

 const Batch = sequelize.define( "Batch", { title: { type: DataTypes.STRING, allowNull: false }, studentIds: { type: DataTypes.STRING }, teacherId: { type: DataTypes.STRING, allowNull: true } }, { timestamps: false } );

En la llamada al método asíncrono, funciona bien.

 Batch.sync().then((res) => { console.log("Batch model sync : ", Batch === sequelize.models.Batch); });

Pero necesito cambiar

 studentIds: { type: DataTypes.ARRAY(DataTypes.STRING)}

Siempre que hago este cambio me da error

ingrese la descripción de la imagen aquí

Estoy usando el nodo 14.5.0 MySql 8.0.21 y Sequelize 6.3.4

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

DataTypes.ARRAY no está disponible en Mysql , solo está disponible en postgres .

Consulte los documentos oficiales: https://sequelize.org/master/class/lib/data-types.js~ARRAY.html

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!