跳到主要内容
版本:v2.5.x

currentUsedDatabase()

This operation checks the database that is currently in use and returns the name of the database.

Java
public String currentUsedDatabase()

Request Syntax

Java
currentUsedDatabase()

RETURN TYPE

String

RETURNS

The name of the database currently in use.

Examples

Java
import io.milvus.param.Constant;
import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;

// 1. Set up a client
ConnectConfig connectConfig = ConnectConfig.builder()
.uri("http://localhost:19530")
.token("root:Milvus")
.build();

MilvusClientV2 client = new MilvusClientV2(connectConfig);

// 2. Get the database currently in use
String currentUsedDatabase = client.currentUsedDatabase();