MongoDB Cloud Plugin
The MongoDB Cloud Plugin for Digital.ai Release enables seamless integration and task automation for MongoDB databases hosted on the cloud. This plugin uses containerized environments to run MongoDB shell scripts for common tasks like inserting and retrieving data, using the Digital.ai Release Runner. It works with both local and cloud MongoDB databases and can be set up for various MongoDB configurations.
To run MongoDB scripts, the MongoDB Cloud Plugin includes a Node.js MongoDB shell client within a container. This Node.js dependency is essential for executing MongoDB shell scripts. For more information about MongoDB shell scripting, see MongoDB Shell Scripting Guide.
The MongoDB Cloud Plugin for Digital.ai Release makes it easy to connect to and automate tasks for MongoDB databases in the cloud.
Features
- Insert Data Task: Inserts specified data into a MongoDB collection.
- Get Data Task: Retrieves data from a MongoDB collection and displays the output.
- Insert and Get Data Task: Combines data insertion and retrieval, allowing a single task to both add new data and return existing data.
Requirements
For MongoDB cloud integration within Digital.ai Release, you need the following:
- A MongoDB cloud server running and accessible via HTTP(s).
- Digital.ai Release Runner setup to run the container tasks.
- A MongoDB database instance created and configured for access.
Set up a MongoDB: Server (Container) - Cloud Server
You can define a MongoDB: Server (Container) - Cloud server configuration in two locations:
- On a global level in Connections under the CONFIGURATION group in the navigation pane.
- On a folder level in Overview > Folders of the navigation pane, under the CONFIGURATION tab of the desired folder.
To set up a connection to a MongoDB cloud server:
- In Release, go to one of the specified locations.
- Under HTTP server connections, next to MongoDB: Server (Container), click . The MongoDB: Server (Container) - Cloud page opens.
- In the Title field, enter the name of the configuration. This name will display in MongoDB Cloud tasks.
- In the URL field, enter the URL to access the server.
- In Username, enter the MongoDB cloud username.
- In Password, enter the MongoDB cloud password.
- To test the connection, click Test.
- To save the configuration, click Save.
Connecting to MongoDB in Various Environments in Digital.ai Release
- Protocol Requirements: When configuring a MongoDB connection in Digital.ai Release, make sure the connection URL includes the correct protocol (
mongodb://
for local instances ormongodb+srv://
for cloud instances) to avoid connection errors. - Connection String Flexibility: Digital.ai Release allows you to directly paste the MongoDB connection URL, obtained from the cloud instance. This simplifies setup and ensures accurate connections across different MongoDB environments.
Insert Data Task (Container)
In Digital.ai Release, you can configure an Insert Data task for MongoDB to insert data into a MongoDB collection:
-
In the release flow tab of a Release template, add a task of type MongoDB > Insert Data (Container).
-
Click the added task to open it.
-
In the Capabilities field, enter a value that matches the capability set for your Runner. This helps you to route jobs to that particular Runner.
-
In the Server field, select the configured MongoDB server to run the script on.
-
In the Script field, enter the MongoDB script.
Note: The Insert Data task does not return an output by default, as it only performs data insertion.
Get Data Task (Container)
In Digital.ai Release, you can configure a Get Data task for MongoDB to retrieve data from a MongoDB collection:
-
In the release flow tab of a Release template, add a task of type MongoDB > Get Data (Container).
-
Click the added task to open it.
-
In the Capabilities field, enter a value that matches the capability set for your Runner. This helps you to route jobs to that particular Runner.
-
In the Server field, select the configured MongoDB server to run the script on.
-
In the Script field, enter the MongoDB script.
Note: The Get Data task fetches data from the database and displays it in the task output, allowing you to view query results directly.
Insert and Get Data Task (Container)
In Digital.ai Release, you can configure an Insert and Get Data task for MongoDB to combine data insertion and retrieval:
-
In the release flow tab of a Release template, add a task of type MongoDB > Insert and Get Data (Container).
-
Click the added task to open it.
-
In the Capabilities field, enter a value that matches the capability set for your Runner. This helps you to route jobs to that particular Runner.
-
In the Server field, select the configured MongoDB server to run the script on.
-
In the Script field, enter the MongoDB script.
Note: This task allows both data insertion and retrieval, providing output that reflects both the newly inserted data and any query results from the script.