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

562
Views
Tipos de datos de Mongoose ¿Cómo definir múltiples valores de tipo? Error ESLint

Me gustaría definir 'líneas' archivadas como una matriz de valores que pueden ser de diferentes tipos (números o cadenas o booleanos o fechas)

cuando intento:

 lines: [ { type: String, content: Mixed }

]

Recibo un error de error de ESLint: Mixed no está definido

¿Debería escribir?

 const Schema = mongoose.Schema; ... lines: [ Schema.Types.Mixed ]
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

De acuerdo con la documentación de mangosta, puede usar el tipo de esquema mixto de la siguiente manera

 var schema = new Schema({ ofMixed: [Schema.Types.Mixed], }) // example use var Thing = mongoose.model('Thing', schema); m.ofMixed = [1, [], 'three', { four: 5 }]; m.save(callback);
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!