Query
MongoDB Plugin – Query Action
Summary (SEO Meta Description):
The Query Action of the MongoDB Plugin runs structured queries against a MongoDB collection.
It enables workflows to retrieve multiple documents based on flexible filtering conditions.
Overview
The Query Action allows your workflow to search and fetch multiple documents from a MongoDB collection using custom criteria.
It is ideal for analytics, reporting, or any automation where you need to pull sets of data that match specific filters.
Typical Use Cases:
- Retrieve all orders placed within a specific date range
- Get a list of active users with a certain subscription type
- Filter IoT telemetry data by device type or location
- Generate a report of products below a specific inventory threshold
⚙️ Configuration
| Field | Description | Type / Options | 
|---|---|---|
| Label | Custom name for the action | String | 
| Collection Name | Target MongoDB collection to query | String | 
| Select connection | Choose or create a MongoDB database connection | Connection | 
| Inputs | Define query filters and parameters as key-value pairs. For each input: | |
| • Name | Field name used in the query | String | 
| • Path | JSON path for nested fields (optional) | String | 
| • Type | Data type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY) | Dropdown | 
| • Value | Value to match in the query | Dynamic / Static | 
| Outputs – Truncate Fields | Toggle to truncate long field values in the output (optional) | Boolean | 
| Schema | Optional: Select a schema to validate and shape the query result | Schema | 
FAQ
Q: What if no documents match the query?
A: The action returns an empty array and the workflow continues without error.
Q: Can I query nested fields?
A: Yes. Use the Path field or standard MongoDB dot-notation for nested fields.
Q: Is there a limit to the number of documents returned?
A: The number of documents is subject to MongoDB’s default limits and any configuration on your database connection.
Keywords: WeHub MongoDB Plugin, MongoDB Query Action, Filter Documents, NoSQL Workflow Automation