Skip to content

XpressAI/xai-mongodb

Repository files navigation

Component LibrariesProject Templates
DocsInstallTutorialsDeveloper GuidesContributeBlogDiscord

Xircuits Component Library to integrate with MongoDB! Seamlessly manage your database operations.


Xircuits Component Library for MongoDB

This library integrates MongoDB functionalities into Xircuits workflows, enabling database management, document operations, and seamless interaction with MongoDB collections and databases.

Table of Contents

Preview

The Example:

mongodb-example

The Result:

mongodb-example_result

Prerequisites

Before you begin, you will need the following:

  1. Python3.9+.
  2. Xircuits.
  3. MongoDB

Main Xircuits Components

Main Xircuits Components

MongoDBInsertDocument Component:

Inserts a document into a specified MongoDB collection.

MongoDBInsertDocument

MongoDBUpdateDocument Component:

Updates documents in a MongoDB collection based on a specified filter.

MongoDBUpdateDocument

InitMongoDBConnection Component:

Establishes a MongoDB connection and provides a client instance.

MongoDBFindDocuments Component:

Retrieves documents based on a query from a MongoDB collection.

MongoDBDeleteDocument Component:

Deletes documents from a MongoDB collection based on a specified query.

Try The Examples

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.

MongoDB example

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.

Installation

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

Database Local Setup

If you prefer to set up MongoDB locally for development or testing, follow these steps:

  1. Download and install MongoDB from MongoDB Downloads. Choose the version compatible with your operating system.
  2. Run MongoDB. Ensure the MongoDB service is accessible via the connection URI used in your components, typically something like mongodb://localhost:27017.
  3. Create the database and collection if it is the first run, then run the xircuits example.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages