Add
MongoDB Plugin – Add Action
Summary (SEO Meta Description):
The Add Action of the MongoDB Plugin inserts a new JSON document into a specified MongoDB collection.
It allows workflows to seamlessly create documents in a NoSQL database without manual scripting.
Overview
The Add Action enables your workflow to insert a new document into a MongoDB collection.
This is ideal when you need to store dynamic or unstructured data as part of an automated process.
Typical Use Cases:
- Add a new customer record after user signup
- Store IoT device telemetry in real time
- Log application events or audit records
- Insert order details in an e-commerce platform
⚙️ Configuration
| Field | Description | Type / Options | 
|---|---|---|
| Label | Custom name for the action | String | 
| Document ID | Optional custom ID for the new document; leave blank to auto-generate | String | 
| Collection Name | Target MongoDB collection where the document will be inserted | String | 
| Select connection | Choose or create a MongoDB database connection | Connection | 
| Inputs | Key-value pairs representing the JSON fields to insert. For each input you can specify: | |
| • Name | Field name in the MongoDB document | String | 
| • Path | JSON path within the document (optional) | String | 
| • Type | Data type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY) | Dropdown | 
| • Value | The actual value to insert | Dynamic / Static | 
FAQ
Q: What happens if I don’t provide a Document ID?
A: MongoDB will automatically generate a unique _id for the document.
Q: Can I insert nested JSON objects?
A: Yes. Use the Path field to target nested structures or specify Type = OBJECT for complex fields.
Q: How are data types handled?
A: Select the correct Type (e.g., DATE, BOOLEAN) to ensure the value is stored in the proper MongoDB BSON format.
Keywords: WeHub MongoDB Plugin, MongoDB Add Action, Insert Document, NoSQL Workflow Automation