clsMongoUpdateObjects Step

Use this step to update the JSOB object in the Mongo DB

Last published at: November 20th, 2024

Description:

This step updates the JSON objects in the Mongo DB.

 

Inputs

  • connID – select Mongo DB connection string
  • dbName - provide database name
  • collectionName - provide collection name
  • jsonFilter - provide JSON filter to match objects for update
  • jsonUpdate - provide JSON data for the update 
 

 

Returns

  • True – step executed successfully
  • False - step failed to execute
 

 

Usage:

 

 

Prerequisite:

Navigate to the Integration - Connections page. Create a new MongoDB connection string as below. Click the Test button to validate the connection response. 

 

Example:

Let’s build and execute the “clsMongoUpdateObjectsDef” example.          

  • Create a new definition called “clsMongoUpdateObjectsDef”
  • Select the definition and click the “design” button
  • Drag “clsMongoGetObjects, and clsMongoUpdateObjects” step from the toolbox
  • Connect the dots between the Start and other steps as above
  • Define variables/globals required for the execution
  • Click the "clsMongoGetObjects" step to configure its "Settings" properties. Provide a name to the step. Select the MongoDB connection string from the drop-down list. Provide the database name. Provide the collection's name. Provide the variable/global reference to store the JSON object fetched during execution. Click the Save button. 

 

  • Click the "clsMongoGetObjects" step to configure its "Advanced" properties. Provide the JSON filter to match the object. Note: This is an optional configuration, and when empty, the step will fetch all the JSON objects.  

 

  • Click the "clsMongoUpdateObjects" step to configure its "Settings" properties. Provide a name to the step. Select the MongoDB connection string from the drop-down list. Provide the database name. Provide the collection's name. Provide the JSON filter to match objects for the update. Provide JSON data for the update operation. Click the Save button. 

 

  • Click the "clsMongoGetObjects" step to configure its "Settings" properties. Provide a name to the step. Select the MongoDB connection string from the drop-down list. Provide the database name. Provide the collection's name. Provide the variable/global reference to store the JSON object fetched during execution. Click the Save button. 

 

  • Click the "clsMongoGetObjects" step to configure its "Advanced" properties. Provide the JSON filter to match the object. Note: This is an optional configuration, and when empty, the step will fetch all the JSON objects.  

 

  • The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute. Render the process instance. Click on the process step to view its variables. The “clsMongoUpdateObjects” step should updates the JSON objects in the Mongo DB as configured.  

 

Definition Sample:

You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.

Click here to download the sample file.