Skip to main content
Version: User Guides (Cloud)

Modify Collection

You can rename a collection or change its settings. This page focuses on how to modify a collection.

Rename Collection

You can rename a collection as follows.

from pymilvus import MilvusClient

client = MilvusClient(
uri="YOUR_CLUSTER_ENDPOINT",
token="YOUR_CLUSTER_TOKEN"
)

client.rename_collection(
old_name="my_collection",
new_name="my_new_collection"
)

Set Collection Properties

The following code snippet demonstrates how to set collection TTL.

from pymilvus import MilvusClient

client.alter_collection_properties(
collection_name="my_collection",
properties={"collection.ttl.seconds": 60}
)

The applicable collection properties are as follows:

Property

When to Use

collection.ttl.seconds

If a collection needs to be dropped for a specific period, consider setting its Time-To-Live (TTL) in seconds. Once the TTL times out, Zilliz Cloud deletes entities in the collection.

The deletion is asynchronous, indicating that searches and queries are still possible before the deletion is complete.

mmap.enabled

Memory mapping (Mmap) enables direct memory access to large files on disk, allowing Zilliz Cloud to store indexes and data in both memory and hard drives. This approach helps optimize data placement policy based on access frequency, expanding storage capacity for collections without impacting search performance.

Zilliz Cloud implements global mmap settings for your clusters. You can change the settings on a specific field or its index.