MongoDB Module Overview
- 16 Dec 2024
- 2 Minutes to read
- Print
- DarkLight
MongoDB Module Overview
- Updated on 16 Dec 2024
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
The MongoDB Module allows a user to configure steps to read and write from a MongoDB database, automatically deserializing to and serializing from a chosen data type.
Example
Prerequisites
The following is required before the MongoDB Module may be properly used:
- A preexisting MongoDB Account.
- Proper installation and set up of the MongoDB Module in Decisions.
For more information on how to install Modules in Decisions, see: Installing Modules.
This example will demonstrate how to set up the MongoDB Module in Decisions.
The MongoDB Module must be installed to be able to configure it. To learn how to install a module navigate here.
- Navigate to System > Integrations. Right-click on MongoDB and select Add MongoDB Server.
- Enter a name for the Entity and check the checkboxes for Get Connection String from Flow, Get Database Name from Flow, Get Collection Name from Flow, and Choose Document Type on Step under SETTINGS. Then, click OK.
Below are the settings configuration options for the MongoDB server in the Entity dialog window.
- Get Connection String from Flow: This is for the connection string to connect to the MongoDB server. If set to true the value needs to be determined at runtime as a step input.
- Get Database Name from Flow: The database name to use. If set to true this value needs to be determined at runtime.
- Get Collection Name from Flow: The collection name to use. If set to true this value needs to be determined at runtime.
- Choose Document Type on Step: The document type to serialize/deserialize while writing to and reading from MongoDB. If only working with a single document type, it can be specified here. Otherwise, check this checkbox to be able to set this at runtime.
Available Steps
The following steps will be available in the Flow Designer Steps panel Integration > All Integrations > MongoDB under the name given when creating the connection.
Steps | Description |
---|---|
Get Document By ID | Fetches a single document by ID |
Fetch Documents | Fetches a list of documents based on the specified filters. Allows users to filter based on a field in the document, a field in a nested document, or by combining these filters with AND/OR. |
Insert Document | Inserts the given document. If the chosen document type has an Id property and a value is specified, that property will be used for the new document. Otherwise, the Id property will be updated to contain the new ID after insertion. |
Replace Document | Entirely replaces one document with another by ID. If the chosen document type has an Id property, its value must match the value of the Document ID input. |
Delete Document | Deletes one document by ID |
There are also steps to manage collections and databases under Integration > All Integrations > MongoDB > Advanced.
Steps | Description |
---|---|
Drop Collection | Removes a collection by name. |
Drop Database | Removes a database by name |
List Collection Names | Returns a list containing the names of all collections in the specified database |
List Database Names | Returns a list containing the names of all databases on the specified MongoDB server |
Rename Collection | Renames the specified collection within the chosen database |
Was this article helpful?