Skip to main content

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

FieldDescriptionType / Options
LabelCustom name for the actionString
Collection NameTarget MongoDB collection to queryString
Select connectionChoose or create a MongoDB database connectionConnection
InputsDefine query filters and parameters as key-value pairs. For each input:
  • NameField name used in the queryString
  • PathJSON path for nested fields (optional)String
  • TypeData type of the field value (NUMBER, STRING, BYTE, DATE, DATETIME, BOOLEAN, OBJECT, ARRAY, ANY)Dropdown
  • ValueValue to match in the queryDynamic / Static
Outputs – Truncate FieldsToggle to truncate long field values in the output (optional)Boolean
SchemaOptional: Select a schema to validate and shape the query resultSchema

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