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

323
Views
Los captadores de secuencias no se ejecutan en model.findall({raw:true})

Tengo un atributo de foto en uno de mis modelos Sequelize. Tengo un captador para ello.

 photo: { type: Sequelize.STRING, get: function () { if (this.getDataValue("photo")) return process.env.IMAGE_PREFIX + this.getDataValue("photo") else return this.getDataValue("photo") } },

pero cuando quiero encontrar todos los registros en este modelo con ({raw:true}) getter no funciona.

 const categories = await Category.findAll({ limit: parseInt(limit), offset: parseInt(offset), raw: true, where: { title: { [Op.like]: '%' + searchString + '%' } } });

si uso ({plain:true}) en su lugar, solo encuentra un registro.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debido a la versión más nueva de sequelize , como dice la propia documentación:

Los getters no se ejecutarán con instance.get({ raw: true }) , use instance.get({ plain: true })

Puedes leer más al respecto aquí

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