This topic describes how to use Tablestore SDK for Node.js to list the names of data tables in an instance.
Prerequisites
A client is initialized. For more information, see Initialize a Tablestore client.
Method description
listTable: function listTable(params, callback)
Sample code
The following sample code demonstrates how to query the list of data tables in an instance and print the table names.
client.listTable({}, function (err, data) {
if (err) {
console.error('error:', err);
return;
}
data.tableNames.forEach(function (tableName) {
console.log(tableName);
});
});