MongoDB Module Overview
  • 22 Jun 2021
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

MongoDB Module Overview

  • Dark
    Light

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.


Prerequisites 
The following is required before the MongoDB Module may be properly used: 
  • A preexisting MongoDB Account.
  • Proper installation and of the MongoDB Module in Decisions. For more information on how to install Modules in Decisions, see: Installing Modules in Decisions


Example 

This example will demonstrate how to set up the MongoDB Module in Decisions.

  1. Navigate to System > Integrations > MongoDB and click ADD MONGODB SERVER.
  2. Enter a name for the Entity and mark 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.

    ParameterDescription
    Get Connection String from FlowThis 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 FlowThe database name to use. If set to true this value needs to be determined at runtime.
    Get Collection Name from FlowThe collection name to use. If set to true this value needs to be determined at runtime.
    Choose Document Type on StepThe 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.

StepsDescription
Get Document By IDFetches a single document by ID
Fetch DocumentsFetches 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 DocumentInserts 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 DocumentEntirely 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 DocumentDeletes one document by ID


There are also steps to manage collections and databases under Integration > All Integrations > MongoDB > Advanced.

StepsDescription
Drop CollectionRemoves a collection by name.
Drop DatabaseRemoves a database by name
List Collection NamesReturns a list containing the names of all collections in the specified database
List Database NamesReturns a list containing the names of all databases on the specified MongoDB server
Rename CollectionRenames the specified collection within the chosen database



Was this article helpful?