Connect to Milvus
python
from pymilvus import MilvusClient
Authentication not enabled
client = MilvusClient("http://localhost:19530")
Authentication enabled with the root user
client = MilvusClient(
uri="http://localhost:19530",
token="root:Milvus",
db_name="default"
)
Authentication enabled with a non-root user
client = MilvusClient(
uri="http://localhost:19530",
token="user:password", replace this with your token
db_name="default"
)
What's New
In this version, PyMilvus adds a MilvusClient module that incorporates several functional methods, aligning its functionality overall with that of the legacy ORM module.
Collection-related methods
- create_collection()
- rename_collection()
- describe_collection()
- has_collection()
- list_collections()
- drop_collection()
- get_collection_stats()
- load_collection()
- release_collection()
- get_load_state()
- refresh_load()
Data-related methods
- insert()
- upsert()
- search()
- query()
- delete()
Alias-related methods
- create_alias()
- drop_alias()
- alter_alias()
- describe_alias()
- list_aliases()
Partition-related methods
- create_partition()
- drop_partition()
- has_partition()
- list_partitions()
- load_partitions()
- release_partitions()
- get_partition_stats()
Index-related methods
- create_index()
- list_indexes()
- drop_index
- describe_index()
User- and RBAC-related methods
- create_user()
- drop_user()
- update_password()
- list_users()
- describe_user()
- grant_role()
- revoke_role()
- create_role()
- drop_role()
- describe_role()
- list_roles()
- grant_privilege()
- revoke_privilege()
Examples
In addition to [the documents](https://milvus.io/api-reference/pymilvus/v2.3.x/About.md), you can also refer to the [example sets](https://github.com/milvus-io/pymilvus/tree/2.3/examples/milvus_client) in our GitHub repo.
Feedback & Issues
If you are having trouble or have questions about PyMilvus, ask your question on our [PyMilvus Community Forum](https://github.com/milvus-io/pymilvus/issues). Once you get an answer, it’d be great if you could work it back into this documentation and contribute!
Contributions
We are committed to building a collaborative, exuberant open-source community for PyMilvus. Therefore, contributions to PyMilvus are welcome from everyone. Refer to [Contributing Guideline](https://github.com/milvus-io/pymilvus/blob/master/CONTRIBUTING.md) before making contributions to this project. You can [file an issue](https://github.com/milvus-io/pymilvus/issues/new/choose) or contact us on [Slack](https://github.com/milvus-io/pymilvus#readme) if you need any assistance or want to propose your ideas about PyMilvus.