milvus-logo
LFAI
< Docs
  • Java

hasCollection()

This operation checks whether a specific collection exists.

public Boolean hasCollection(HasCollectionReq request)

Request Syntax

hasCollection(HasCollectionReq.builder()
    .collectionName(String collectionName)
    .build()
)

BUILDER METHODS:

  • collectionName(String collectionName)

    The name of a collection.

RETURN TYPE:

bool

RETURNS:

A boolean value indicating whether the specified collection exists.

EXCEPTIONS:

  • MilvusClientExceptions

    This exception will be raised when any error occurs during this operation.

Example

// check whether collection test exists
HasCollectionReq hasCollectionReq = HasCollectionReq.builder()
        .collectionName("test")
        .build();
Boolean resp = client.hasCollection(hasCollectionReq);

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?