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

126
Views
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 answers
Answer question

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 Report

0

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

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!