Drop an index (HTTP)
|
For details about additional languages, see: |
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
}
}
Parameters
Use the dropIndex command.
Command signature
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"
}
}'
| 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/api/json/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.