Mongo DB
Integrating MongoDB with Qyver
This guide provides step-by-step instructions on configuring and integrating MongoDB with Qyver.
Configuring an Existing Managed MongoDB Instance
To use MongoDB with Qyver, ensure your MongoDB version supports Atlas Vector Search. Refer to the official MongoDB documentation for more details.
Qyver requires access to MongoDB to manage Atlas Search Indexes. MongoDB’s instance size affects how these indexes can be created, listed, and deleted. Specifically:
Instances below M10 do not allow these operations via a standard user and require access through the administration API.
Larger instances allow direct index management.
To support all instance types, Qyver uses the administration API for index management. This requires an API key with the Project Data Access Admin role. Instructions for creating this key are included below.
Note: The API requires both a project ID and cluster name. Instructions on retrieving this information are also provided.
Configuration Modifications
To integrate MongoDB, add the MongoDBVectorDatabase
class and include it in the executor:
Finding Your Project ID
In MongoDB Atlas, select your organization from the top left corner.
Find your project but do not click on it.
Click the Actions (···) menu in the last column and select Copy Project ID.
Alternatively, your Project ID is in the URL when viewing a project:
https://cloud.mongodb.com/v2/<PROJECT_ID>#/overview
Make sure to copy the correct ID and not the organization ID.
Setting Up the Executor
Once the MongoDBVectorDatabase is configured, assign it to the executor:
Starting a Managed MongoDB Instance
Follow these steps to set up a MongoDB Atlas instance:
Create the Database
Sign in to MongoDB Atlas.
Create a cluster and note the cluster name.
Click Database from the left menu.
Once the cluster is created, open it and navigate to the Collections tab.
Click Add My Own Data, enter a database name, and create a collection.
Create a Database User and Allow IP Access
Click Database from the left menu.
Click Connect next to your cluster.
In the pop-up, allow access from any IP or specify your machine’s IP.
Create a database user with a username and password.
Generate an API Key
Go to Access Manager and select your project.
Open the API Keys tab.
Create an API key with the Project Data Access Admin role.
Save the private key (it will not be accessible again).
Last updated