64bit integer in JavaScript, from Mysql request -


i have number 76561197993482001 (64bit int) stored bigint(20) in database.

but when try fetch using :

//node.js     query('select * table',function(err,rows){       console.log(rows[0]["id"]);// 76561197993482000       }); 

i wrong number. guess because js can't handle 64bit variables.

i know there libraries bigint in js number directly stored in rows variable. how can do?

is there way convert text when send request?

depending on middleware you're using, of them have setting enables support big numbers, common middleware uses supportbignumbers option this

var mysql      = require('mysql'); var connection = mysql.createconnection({   host              : 'example.org',   user              : 'bob',   password          : 'secret',   supportbignumbers : true }); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -