Skip to main content

Delete

Deletes one or more entities from a collection.

📘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:passowrd.

export CLUSTER_ENDPOINT="https://inxx-xxxxxxxxxxxxxxx.api.gcp-us-west1.zillizcloud.com:19530"
export TOKEN="db_admin:xxxxxxxxxxx"

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
}'

Possible response is similar to the following.

{
"code": 200,
"data": {}
}

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

  • No header parameters required

Request Body​

Option 1:​

{
"collectionName": "string",
"id": "string"
}
ParameterDescription
collectionNamestring
The name of the collection to which this operation applies.
idstring
The ID of the entity to be retrieved

Option 2:​

{
"collectionName": "string",
"id": []
}
ParameterDescription
collectionNamestring
The name of the collection to which this operation applies.
idarray
An array of IDs of the entities to be retrieved
id[]string

Option 3:​

{
"collectionName": "string",
"id": "integer"
}
ParameterDescription
collectionNamestring
The name of the collection to which this operation applies.
idinteger
The ID of the entity to be retrieved

Option 4:​

{
"collectionName": "string",
"id": []
}
ParameterDescription
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 Body​

{
"code": "integer",
"data": {}
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
dataobject

Error Response​

{
"code": integer,
"message": string
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
messagestring
Indicates the possible reason for the reported error.