milvus-logo
LFAI
< Docs
  • Python
    • MilvusClient

MilvusClient()

This is the constructor method to create a MilvusClient instance.

Invocation

MilvusClient(
    uri,
    user,
    password,
    db_name,
    token,
    timeout
)

Parameters

ParameterDescriptionTypeRequired
uriAddress used to connect to the Milvus instance. Default value: 'http://localhost:19530'.StringTrue
userUsername used to connect to the Milvus instance.StringTrue
passwordPassword used to connect to the Milvus instance.StringTrue
db_nameName of the specific database to connect.StringFalse
tokenCredentials used to connect to the Milvus instance in token='user:password' format.StringTrue
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

You can use either separate parameters user and password or token='user:password' as credentials.

Return

A MilvusClient instance.

Raises

None

Example

  • Create a MilvusClient instance using token:

    from pymilvs import MilvusClient
    
    client = MilvusClient(
    uri='http://localhost:19530',
    token='root:Milvus',
    )
    
  • Create a MilvusClient instance using separate parameters user and password

    from pymilvs import MilvusClient
    
    client = MilvusClient(
    uri='http://localhost:19530',
    user='root',
    password='Milvus'
    )
    
Feedback

Was this page helpful?