Delete a data table from an instance by using Tablestore SDK for Node.js.
Usage notes
If a search index exists for the data table, delete the search index before deleting the data table.
If a secondary index exists for the data table, it is automatically deleted along with the data table.
Deleted data tables and secondary indexes cannot be restored. Proceed with caution.
Prerequisites
A client is initialized. For more information, see Initialize a Tablestore client.
API reference
deleteTable: function deleteTable(params, callback)
Sample code
The following example deletes a data table named test_table.
var params = {
tableName: 'test_table'
};
client.deleteTable(params, function (err, data) {
if (err) {
console.error('error:', err);
return;
}
console.log('success:', data);
});