< Docs
  • Java
    • v1


The MilvusClient interface. This method drops a database. Note that this method drops all data in the database.

R<RpcStatus> dropDatabase(DropDatabaseParam requestParam);


Use the DropDatabaseParam.Builder to construct a DropDatabaseParam object.

import io.milvus.param.DropDatabaseParam;
DropDatabaseParam.Builder builder = DropDatabaseParam.newBuilder()

Methods of DropDatabaseParam.Builder:

Method Description Parameters
withDatabaseName(String databaseName) Sets the databaseName name. Database name cannot be empty or null. databaseName: The database name
build() Construct a CreateDatabaseParam object. N/A

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


This method catches all the exceptions and returns an R<RpcStatus> object.

  • If the API fails on the server side, it returns the error code and message from the server.

  • If the API fails by RPC exception, it returns R.Status.Unknown and the error message of the exception.

  • If the API succeeds, it returns R.Status.Success.


import io.milvus.param.*;

DropDatabaseParam param = DropDatabaseParam.newBuilder()
R<RpcStatus> response = client.dropDatabase(param)
if (response.getStatus() != R.Status.Success.getCode()) {