Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
How can I return data from a MySQL query without it being [Object, object] and also, not a string via JSON.stringify?

I am getting the following results from SELECT query to a table in a MySQL db:

[
  RowDataPacket {
    id: 1,
    title: 'foo',
    date: 2012-07-06T08:40:14.000Z
  },
  RowDataPacket {
    id: 2,
    title: 'foo',
    date: 2021-12-16T16:00:12.000Z
  },
  RowDataPacket {
    id: 3,
    title: 'foo',
    date: 2012-07-06T08:40:14.000Z
  },
  RowDataPacket {
    id: 4,
    title: 'foo',
    date: 2019-12-02T14:13:41.000Z
  },
  RowDataPacket {
    id: 5,
    title: 'foo',
    date: 2019-11-25T12:46:25.000Z
  },
  RowDataPacket {
    id: 6,
    title: 'foo',
    date: 2021-12-17T16:00:12.000Z
  },
  RowDataPacket {
    id: 7,
    title: 'foo',
    date: 2021-12-15T16:00:12.000Z
  }
]

How can I return this within a response to an API call without it being returned as [object, object]?

I want to return it without it being a string as a string isn't that useable compared to JSON.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda