milvus-logo
LFAI
< Docs
  • Python

set_properties()

This method modifies the current collection by setting its properties. Currently, you can only change the time-to-live (TTL) property of the collection by setting collection.ttl.seconds.

Invocation

set_properties(properties, timeout=None)

Parameters

ParameterDescriptionTypeRequired
propertiesA dictionary comprising pairs of properties and valuesDictionaryTrue
timeoutAn optional duration of time in seconds to allow for the RPC. If it is set to None, the client keeps waiting until the server responds or error occurs.FloatFalse

Returns

No returns

Example

from pymilvus import connections, Collection, FieldSchema, CollectionSchema, DataType
connections.connect()
fields = [
    FieldSchema("film_id", DataType.INT64, is_primary=True),
    FieldSchema("films", dtype=DataType.FLOAT_VECTOR, dim=128)
]
schema = CollectionSchema(fields=fields)
collection.set_properties({"collection.ttl.seconds": 60})
Feedback

Was this page helpful?