milvus-logo
LFAI
< Docs
  • RESTful

Has Collection

POST
http://${MILVUS_URI}/v2/vectordb/collections/has

This operation checks whether a collection exists.

Example

export MILVUS_URI="localhost:19530"

curl --location --request POST "http://${MILVUS_URI}/v2/vectordb/collections/has" \
--header "Content-Type: application/json" \
--data-raw '{
    "dbName": "default",
    "collectionName": "quick_setup"
}'

The possible response is similar to the following:

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

Request

Parameters

  • Header parameters

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

  • No path parameters required

Request Body

{
    "dbName": "string",
    "collectionName": "string"
}
ParameterDescription
dbNamestring
The name of the database in which to check the existence of a collection.
collectionName *string
The name of an existing collection.

Response

A boolean value indicates whether the specified partition exists.

Response Bodies

  • Response body if we process your request successfully
{
    "code": "integer",
    "data": {
        "has": "boolean"
    }
}
  • 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
data.hasboolean
A boolean value indicates whether the specified partition exists.