This library provides components for managing MongoDB operations within Xircuits, such as establishing connections and handling data manipulation.
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.
- InitMongoDBConnection: Establishes a MongoDB connection and provides a client instance.
- MongoDBInsertDocument: Inserts a document into a specified MongoDB collection.
- MongoDBFindDocuments: Retrieves documents based on a query from a MongoDB collection.
- MongoDBUpdateDocument: Updates documents in a MongoDB collection based on a specified filter.
- MongoDBDeleteDocument: Deletes documents from a MongoDB collection based on a specified query.