Tablestore supports five data types. This topic describes how these data types correspond to those supported in Tablestore SDK for Node.js.

Note For more information about data types of Tablestore, see Naming conventions and data types.
Data type (Tablestore) Data type (SDK for Node.js) Description
STRING string The basic data type in JavaScript.
INTEGER int64 The type of data encapsulated by Node.js SDK.
DOUBLE number The basic data type in JavaScript.
BOOLEAN boolean The basic data type in JavaScript.
BINARY Buffer The Buffer object of Node.js.

The INTEGER data in Tablestore is a 64-bit signed integer, which does not have a corresponding data type in JavaScript. Therefore, a data type that can indicate a 64-bit signed integer is required for Node.js. The following code provides an example on how to convert the INTEGER data type of Tablestore:

var numberA = TableStore.Long.fromNumber(1000);
var numberB = TableStore.Long.fromString('2000');

var num = numberA.toNumber();
    num = numberA.toString();

var str = numberB.toNumber();
    str = numberB.toString();