Component Libraries •
Project Templates
Docs •
Install •
Tutorials •
Developer Guides •
Contribute •
Blog •
Discord
Xircuits Component Library to integrate with MongoDB! Seamlessly manage your database operations.
This library integrates MongoDB functionalities into Xircuits workflows, enabling database management, document operations, and seamless interaction with MongoDB collections and databases.
Before you begin, you will need the following:
- Python3.9+.
- Xircuits.
- MongoDB
Inserts a document into a specified MongoDB collection.
Updates documents in a MongoDB collection based on a specified filter.
Establishes a MongoDB connection and provides a client instance.
Retrieves documents based on a query from a MongoDB collection.
Deletes documents from a MongoDB collection based on a specified query.
We have provided an example workflow to help you get started with the MongoDB component library. Give it a try and see how you can create custom MongoDB components for your applications.
This example demonstrates how to use Xircuits with MongoDB. It initializes a MongoDB connection, inserts a document into a collection, and retrieves documents matching a specific query. The retrieved results are then printed for verification.
To install this component library in Xircuits, you can use the tray library interface or use the following command:
xircuits install mongodb
Alternatively, for manual setup:
git clone https://github.com/XpressAI/xai-mongodb xai_components/xai_mongodb
cd xai_components/xai_mongodb
pip install -r requirements.txt
If you prefer to set up MongoDB locally for development or testing, follow these steps:
- Download and install MongoDB from MongoDB Downloads. Choose the version compatible with your operating system.
- Run MongoDB. Ensure the MongoDB service is accessible via the connection URI used in your components, typically something like mongodb://localhost:27017.
- Create the database and collection if it is the first run, then run the xircuits example.