Drop an index (HTTP)
|
For details about additional languages, see: |
|
Tables with the Data API are currently in public preview. Development is ongoing, and the features and functionality are subject to change. Hyper-Converged Database (HCD), and the use of such, is subject to the DataStax Preview Terms. |
Deletes an index from a table in a database.
|
Ready to write code? See the examples for this method to get started. |
Result
Deletes the specified index.
If the command succeeds, the response indicates the success.
Example response:
{
"status": {
"ok": 1
}
}
Signature
Use the dropIndex command.
curl -sS -L -X POST "API_ENDPOINT/api/json/v1/KEYSPACE_NAME" \
--header "Token: APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"dropIndex": {
"name": "INDEX_NAME"
}
}'
Parameters
| Name | Type | Summary |
|---|---|---|
|
|
The name of the index to delete. |
Examples
The following examples demonstrate how to drop an index from a table.
Drop an index
curl -sS -L -X POST "API_ENDPOINT/v1/KEYSPACE_NAME" \
--header "Token: APPLICATION_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"dropIndex": {
"name": "INDEX_NAME"
}
}'
Drop an index only if the index exists
This option has no literal equivalent in HTTP. Instead, you can list the index names to see if an index with the name already exists.