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

truncate()

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

Request Syntax​

Python
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​

Python
from pymilvus import Collection

collection = Collection("test")

collection.truncate()