Example
This example Data Stream demonstrates how to use the Action Agent to write business data to a table in a MongoDB database.
Refer to configuration to understand all configuration options of this Agent.
Step 1: Add the Agent
Drag the MongoDB Action Agent onto the canvas and rename it. Link the input endpoint to the event data and the output to the printer. Save the Data Stream.
Step 2: Configure General
Select the Agent and click Configure. In this case, keep the default Collection.
Step 3: Configure Server
Enter the Authentication details of the MongoDB database to which you want to connect: server, port number, and authentication type. In this case, leave the authentication type as Anonymous.
Step 4: Configure Database
Select the database and table/collection. In this case, select the Appdb database and Business table/collection.
Apply the changes and save the Data Stream.
Step 5: Input Mapping
Select the MongoDB Action Agent's input arrow and click Configure. Map one of the parent Agent's output attributes to each input attribute, which is fetched from the MongoDB table.
In this case, click Auto Map to map those with the same name and data type; and manually select the rest.
Step 6: Results
Apply the changes, save the Data Stream, and publish it.
Click the Live Data View button. Observe the business data is printed, as well as posted to MongoDB.
Let's look at MongoDB. Observe the business data were successfully written to the business table.
Files
See the Import, Export, and Clone - XMPro article for steps to import a Data Stream.
Last updated