Skip to main content

Delete

Deletes one or more entities from a collection.


POST
https://{cluster-endpoint}/v1/vector/delete

Example

Notes

You can use either of the following ways to authorize:

  • An API Key with appropriate permissions.
  • A colon-joined username and password of the target cluster. For example, username:p@ssw0rd.

Currently, data of the JSON and Array types are not supported in RESTful API requests..

  • Delete a collection whose ID is an integer.
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/delete" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"id": 1
}'
  • Delete a collection whose ID is a string.
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/delete" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"id": "id1"
}'
  • Delete a list of collections whose IDs are integers.
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/delete" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"id": [1,2,3,4]
}'
  • Delete a list of collections whose IDs are strings.
curl --request POST \
--url "${CLUSTER_ENDPOINT}/v1/vector/delete" \
--header "Authorization: Bearer ${TOKEN}" \
--header "accept: application/json" \
--header "content-type: application/json" \
-d '{
"collectionName": "medium_articles",
"id": ["id1", "id2", "id3","id4"]
}'

Request

Parameters

  • No query parameters required

  • No path parameters required

Request Body

{
"dbName": "string",
"collectionName": "string",
"id": "string"
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
idstring
The ID of the entity to be retrieved
{
"dbName": "string",
"collectionName": "string",
"id": []
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
idarray
An array of IDs of the entities to be retrieved
id[]string
{
"dbName": "string",
"collectionName": "string",
"id": "integer"
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
idinteger
The ID of the entity to be retrieved
{
"dbName": "string",
"collectionName": "string",
"id": []
}
ParameterDescription
dbNamestring
The name of the database.
collectionNamestring
The name of the collection to which this operation applies.
idarray
An array of IDs of the entities to be retrieved
id[]integer

Response

Returns an empty object.

Response Bodies

  • Response body if we process your request successfully
{
"code": "integer",
"data": {}
}
  • Response body if we failed to process your request
{
"code": integer,
"message": string
}

Properties

The properties in the returned response are listed in the following table.

PropertyDescription
codeinteger
dataobject
messagestring
Indicates the possible reason for the reported error.

Possible Errors

CodeError Message
80000Incorrect parameter: xxx
80001The token is illegal
80002The token is invalid
80020Cluster not exist or you don't have permission.
80022Dedicated cluster not support this operation.
90001The collection xxx does not exist. You can use ListCollections to view the list of existing collections.
90011Invalid CollectionName. Reason: Name contains only alphanumeric letters and underscores
90102The cluster does not exist in current region.
90103The clusterId parameter is empty in the request path.
90110No filter key field.
90123The inputted ID value does not match the field xxx
90124no id key field
90127Please use xxx in (a
90128Not contains data to filter
90129Filter dataType not support
90132No delete content provided.
90139Type mismatch for field 'xxx'. expected type:xxx
90140The number of elements in parameter 'id' should not exceed 100.