milvus-logo
LFAI
< Docs
  • RESTful
    • v2

Delete

POST
http://${MILVUS_URI}/v2/vectordb/entities/delete

This operation deletes entities by their IDs or with a boolean expression.

Example

export MILVUS_URI="localhost:19530"

curl --location --request POST "http://${MILVUS_URI}/v2/vectordb/entities/delete" \
--header "Content-Type: application/json" \
--data-raw '{
    "collectionName": "quick_setup",
    "filter": "id in [0,1]"
}'

Possible response is similar to the following.

{
    "code": 0,
    "data": {}
}

Request

Parameters

  • Header parameters

    ParameterDescription
    Request-Timeoutinteger
    The timeout duration for this operation.
    Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.
    Authorizationstring
    The authentication token.
  • No query parameters required

  • No path parameters required

Request Body

{
    "dbName": "string",
    "collectionName": "string",
    "filter": "string",
    "partitionName": "string"
}
ParameterDescription
dbNamestring
The name of the target database.
collectionName *string
The name of an existing collection.
filter *string
A scalar filtering condition to filter matching entities. The value defaults to an empty string, indicating that no condition applies. Setting both id and filter results in an error.
You can set this parameter to an empty string to skip scalar filtering. To build a scalar filtering condition, refer to Boolean Expression Rules.
partitionNamestring
The name of a partition in the current collection.
If specified, the data is to be deleted from the specified partition.

Response

A dictionary contains the number of deleted entities.

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
Indicates whether the request succeeds.
  • 200: The request succeeds.
  • Others: Some error occurs.
messagestring
Indicates the possible reason for the reported error.
dataobject