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

231
Views
¿Cómo agregar una matriz dentro de una matriz en el validador Joi para el esquema de mangosta?

Recibo este error al compilar el node index código.

 Invalid schema configuration: `undefined` is not a valid type within the array `location`.

Cuando agrego esto al esquema de validación de Joi, aparece el error.

 joi.array().items(joi.array().items(joi.number().integer())).default([]),

La matriz que quiero validar,

 { // other fields.. location: [[1,32,145], [0,1,null]], // other field }

He intentado otras iteraciones para averiguar qué causa el error.

 joi.array().items().default([]) // No error joi.array().items(joi.number().integer()) // No error joi.array().items(joi.array().items()) // This caused error

Creo que agregar una matriz dentro de una matriz está causando el error.

IMP NOTA: Usar un esquema como este y un error al respecto.

 new mongoose.Schema(joigoose.convert(PSS), { _id: false, versionKey: false })

Agregué manualmente la matriz dentro de una matriz en el documento MongoDB, lo que significa que este error es con mangosta, ya que joi permite una matriz dentro de una matriz.

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