truncate()

This operation truncates the current collection, removing all its data. It has the same effect as utility.truncate_collection().

Request Syntax

truncate(
    timeout: float | None = None
)

PARAMETERS:

  • timeout (float | None) -

    The timeout duration for this operation. Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.

RETURN TYPE:

NoneType

RETURNS:

None

EXCEPTIONS:

  • MilvusException

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

Examples

from pymilvus import Collection

collection = Collection("test")

collection.truncate()

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?