使用 Node.js SDK 删除指定数据表中的全局二级索引或本地二级索引,不影响数据表及表中数据。
前提条件
已初始化Client。具体操作,请参见初始化Tablestore Client。
已创建二级索引。具体操作,请参见创建二级索引。
注意事项
二级索引删除后不可恢复,如需再次使用请重新创建二级索引。
参数
|
参数 |
说明 |
|
mainTableName |
数据表名称。 |
|
indexName |
索引表名称。 |
示例
var client = require('./client');
client.dropIndex({
mainTableName: "<TABLE_NAME>", //设置数据表名称。
indexName: "<INDEX_NAME>" //设置索引表名称。
}, function (err, data) {
if (err) {
console.log('error:', err);
return;
}
console.log('success:', JSON.stringify(data, null, 2));
});