Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

MongoDB Connector 6.3 Examples - Mule 4

Invoke an Operation

To invoke a simple operation, such as the Insert Document operation, follow these steps:

  1. In Studio, click HTTP and drag the Listener operation to the canvas.

  2. From the palette, select MongoDB and drag the Insert Document operation into your flow by placing it to the right of HTTP Listener.

  3. Configure the connector by selecting the Connector Configuration you created in the previous section, choosing the operation to invoke, and setting the Collection name.

  4. From the palette, drag the Transform Message component to the left of MongoDB Connector.

  5. Click Transform Message and enter two key-value pairs:

    %dw 2.0
    %output application/json
    ---
    {
    	name:"Peter",
    	age:"42"
    }
    dataweave
  6. From the Mule Palette view, drag other Transform Message components to the right of MongoDB Connector.

  7. Click Transform Message and set the output to application/json:

    %dw 2.0
    output application/json
    ---
    payload
    dataweave

XML for Invoke an Operation

View on GitHub