dropCollectionProperties()
This operation resets the properties of a specified collection to their default values.
java
public Void dropCollectionProperties(DropCollectionPropertiesReq request)
Request Syntax
java
dropCollectionProperties(DropCollectionPropertiesReq.builder()
.databaseName(String databaseName)
.collectionName(String collectionName)
.propertyKeys(List<String> propertyKeys)
.build()
)
BUILDER METHODS:
-
databaseName(String databaseName)The name of the database that holds the target collection.
-
collectionName(String collectionName)The name of the target collection.
-
propertyKeys(List<String> propertyKeys)The properties to reset to their default values. Supported properties are as follows:
-
collection.ttl.seconds -
The time-to-live (TTL) of a collection in seconds.
-
mmap.enabled -
Whether to enable mmap for the raw data and indexes of all fields in the collection.
-
EXCEPTIONS:
-
MilvusClientExceptions
This exception is raised when any error occurs during this operation.
Example
java
import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import io.milvus.v2.service.collection.request.DropCollectionPropertiesReq;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
// 1. Set up a client
ConnectConfig connectConfig = ConnectConfig.builder()
.uri("YOUR_CLUSTER_ENDPOINT")
.token("YOUR_CLUSTER_TOKEN")
.build();
MilvusClientV2 client = new MilvusClientV2(connectConfig);
// 2. Drop the \`collection.ttl.seconds\` property
List<String> propertyKeys = new ArrayList<>();
propertyKeys.add("collection.ttl.seconds");
DropCollectionPropertiesReq dropCollectionPropertiesReq = DropCollectionPropertiesReq.builder()
.collectionName("test")
.propertyKeys(propertyKeys)
.build();
client.dropCollectionProperties(dropCollectionPropertiesReq);