Skip to main content

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

FieldDescriptionType / Options
LabelCustom name for the actionString
Document IDOptional custom ID for the new document; leave blank to auto-generateString
Collection NameTarget MongoDB collection where the document will be insertedString
Select connectionChoose or create a MongoDB database connectionConnection
InputsKey-value pairs representing the JSON fields to insert. For each input you can specify:
  • NameField name in the MongoDB documentString
  • PathJSON path within the document (optional)String
  • TypeData type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY)Dropdown
  • ValueThe actual value to insertDynamic / 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