Skip to main content
Version: User Guides (BYOC)

View Collections

You can obtain the name list of all the collections in the currently connected database, and check the details of a specific collection.

List Collections

The following example demonstrates how to obtain the name list of all collections in the currently connected database.

from pymilvus import MilvusClient, DataType

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

res = client.list_collections()

print(res)

If you have already created a collection named quick_setup, the result of the above example should be similar to the following.

["quick_setup"]

Describe Collection

You can also obtain the details of a specific collection. The following example assumes that you have already created a collection named quick_setup.

res = client.describe_collection(
collection_name="quick_setup"
)

print(res)

The result of the above example should be similar to the following.

{
'collection_name': 'quick_setup',
'auto_id': False,
'num_shards': 1,
'description': '',
'fields': [
{
'field_id': 100,
'name': 'id',
'description': '',
'type': <DataType.INT64: 5>,
'params': {},
'is_primary': True
},
{
'field_id': 101,
'name': 'vector',
'description': '',
'type': <DataType.FLOAT_VECTOR: 101>,
'params': {'dim': 768}
}
],
'functions': [],
'aliases': [],
'collection_id': 456909630285026300,
'consistency_level': 2,
'properties': {},
'num_partitions': 1,
'enable_dynamic_field': True
}