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

125
Visualizações
MySQL In NodeJS is grabbing IDs from a database but it's changing the last 2 digits of it to 00

I'm having troubles with MySQL for node, when I see the IDs on the DB, they look fine, but when I grab it with the MySQL (code below) the last 2 digits are replaced by 0, any ideas on what's happening & how to solve it? I also will attach a picture of the database data & settings Settings Data

dbPool.getConnection((err, con) => {
        if (err) throw err
        con.query(`SELECT * FROM node_1 WHERE gid`, (err, rows:guildData[]) => {
            if(err) throw err
            rows.forEach(row => {
                client.dataGuilds.set(`${row.gid}`, row)
                console.log(row.gid)
            })
        })
        con.release()
})
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The problem is that DB bigint exceeds Number.MAX_SAFE_INTEGER. You can use BitInt(x) to convert:

const x = BigInt(928711151708167415);
console.log(x);
about 4 years ago · Juan Pablo Isaza Relatório

0

Solved, instead of turning a bigint into a string, just store it as an string

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