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

294
Vistas
Sequelize: how to return a specific value from a field

enter image description here Hi everyone! I'm new to databases, sequelize and other stuff but I'm trying to learn! I have this table called "Posts" and I have like 3 fake migrations

What I want is to have back only a value. I've seen this but it doesn't really help me... So if I want "ipsum" I can write this SQL in DBeaver: select * from "posts" where "type"='ipsum'. And it works. But I need to do the same in Sequelize. I tried

export const loadNewPost = async (components) => {
  try {
    const newPost = await components.db.Posts.findAll({
      where: {
        type: "ipsum",
      },
    });
    return newPost;
  } catch (e) {
    throw e;
  }
};

But it doesn't work! (then I should place this function into an endpoint, but this is another story!) Any help would be really appreciated! Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to be careful with the comma, in this case “ type: "ipsum", “ Becomes: “ type: "ipsum" “

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