MongoDB implementation of the VectorDatabase. This class provides a MongoDB-based vector database connector.

Constructor

MongoDBVectorDatabase(host, db_name, cluster_name, project_id, admin_api_user, admin_api_password, default_query_limit=10, vector_precision=Precision.FLOAT16, **extra_params)
Initialize the MongoDBVectorDatabase with connection parameters and configuration.

Parameters

host
str
required
The hostname of the MongoDB server.
db_name
str
required
The name of the database.
cluster_name
str
required
The name of the MongoDB cluster.
project_id
str
required
The project ID for MongoDB.
admin_api_user
str
required
The admin API username.
admin_api_password
str
required
The admin API password.
default_query_limit
int
default:"10"
Default vector search limit. MongoDB does not have a default for it so setting it to a reasonable number of 10.
vector_precision
Precision
default:"Precision.FLOAT16"
Precision to use for storing vectors. Defaults to FLOAT16.
**extra_params
Any
Additional parameters for the MongoDB connection.

Inheritance

Inheritance Chain:
  • MongoDBVectorDatabase
  • VectorDatabase
  • ABC
  • Generic