All Products
Search
Document Center

Tablestore:Delete a secondary index

Last Updated:Sep 20, 2026

Use Tablestore SDK for Node.js to delete a global or local secondary index without affecting the data table or its data.

Prerequisites

Precautions

A deleted secondary index cannot be recovered. To use the index again, create a new secondary index.

Parameters

Parameter

Description

mainTableName

The name of the data table.

indexName

The name of the index table.

Examples

The following sample code shows how to delete a secondary index from a data table by calling the dropIndex method.

var client = require('./client');

client.dropIndex({
  mainTableName: "<TABLE_NAME>", // Specify the name of the data table.
  indexName: "<INDEX_NAME>" // Specify the name of the index table.
}, function (err, data) {
  if (err) {
    console.log('error:', err);
    return;
  }
  console.log('success:', JSON.stringify(data, null, 2));
});