Common Properties (All Operations)
| Property | Required | Description |
credential_id | Required | Reference to a MongoDB connection credential stored in BizFirst Credentials Manager. The credential holds the full connection string including authentication and cluster hostname. |
resource | Required | The resource type to operate on. Use document for collection CRUD and aggregation, or search-index for Atlas Search index management. |
operation | Required | The operation to perform within the selected resource. See per-operation sections below. |
database | Required | The MongoDB database name. Supports BizFirst expressions for dynamic database selection (e.g. {{ vars.tenant_db }}). |
collection | Required | The MongoDB collection name. Supports expressions. |
find — Properties
| Property | Required | Description |
filter | Required | MongoDB query filter as a JSON object. Use standard MongoDB query operators: $eq, $gt, $lt, $in, $and, $or, $regex, etc. Supports BizFirst expressions within filter values. |
projection | Optional | Fields to include or exclude in the response. Use {"field": 1} for inclusion and {"field": 0} for exclusion. Cannot mix inclusion and exclusion (except for _id). |
sort | Optional | Sort order as a JSON object. Use 1 for ascending and -1 for descending. Example: {"created_at": -1}. |
limit | Optional | Maximum number of documents to return. Default: no limit. For performance, always set a limit when the result set may be large. Supports expressions. |
skip | Optional | Number of documents to skip before returning results. Use with limit to implement pagination. |
// find — example configuration
{
"credential_id": "mongodb-atlas-prod",
"resource": "document",
"operation": "find",
"database": "ecommerce",
"collection": "orders",
"filter": {
"customer_id": "{{ vars.customer_id }}",
"status": { "$in": ["pending", "processing"] },
"created_at": { "$gte": "{{ vars.date_from }}" }
},
"projection": { "order_id": 1, "status": 1, "total_amount": 1, "created_at": 1, "_id": 0 },
"sort": { "created_at": -1 },
"limit": 50
}
insert — Properties
| Property | Required | Description |
document | Optional | A single document object to insert. Use this when inserting one record. Supports BizFirst expressions throughout the document structure. |
documents | Optional | An array of document objects for bulk insertion. Use this to insert multiple records in a single operation. Either document or documents must be provided. |
// insert — single document example
{
"credential_id": "mongodb-atlas-prod",
"resource": "document",
"operation": "insert",
"database": "audit",
"collection": "workflow_runs",
"document": {
"workflow_id": "{{ workflow.id }}",
"triggered_by": "{{ vars.user_email }}",
"started_at": "{{ workflow.started_at }}",
"input_payload": "{{ vars.input_payload }}",
"status": "completed",
"duration_ms": "{{ vars.duration_ms }}"
}
}
update — Properties
| Property | Required | Description |
filter | Required | Selects which documents to update. Uses the same query syntax as find. Provide a precise filter to avoid unintended bulk updates. |
update | Required | The update specification using MongoDB update operators. Common operators: $set (set field values), $push (append to array), $inc (increment), $unset (remove field), $addToSet (add to array without duplicates). |
upsert | Optional | If true, insert a new document when no document matches the filter. Default: false. |
multi | Optional | If true, update all matching documents. If false (default), update only the first matching document. |
// update — order status update example
{
"credential_id": "mongodb-atlas-prod",
"resource": "document",
"operation": "update",
"database": "ecommerce",
"collection": "orders",
"filter": { "order_id": "{{ vars.order_id }}" },
"update": {
"$set": {
"status": "{{ vars.new_status }}",
"updated_at": "{{ now() }}",
"last_updated_by": "{{ vars.processor_name }}"
},
"$push": {
"status_history": {
"status": "{{ vars.new_status }}",
"changed_at": "{{ now() }}",
"changed_by": "{{ vars.processor_name }}"
}
}
},
"upsert": false,
"multi": false
}
delete — Properties
| Property | Required | Description |
filter | Required | Selects which documents to delete. Must not be an empty object {} — BizFirst blocks empty-filter deletes to prevent accidental collection wipes. |
delete_many | Optional | If true, delete all documents matching the filter. If false (default), delete only the first matching document. |
find-one-and-update — Properties
| Property | Required | Description |
filter | Required | Query to select the document to update. |
update | Required | Update specification using MongoDB update operators. |
return_document | Optional | Which document to return. "before" returns the document as it was before the update (default). "after" returns the document as it is after the update. |
upsert | Optional | Insert if no match found. Default: false. |
sort | Optional | When multiple documents match, sort determines which one is selected. Example: {"priority": -1} picks the highest-priority document. |
aggregate — Properties
| Property | Required | Description |
pipeline | Required | An array of aggregation stage objects. Each stage is a JSON object with a single key that is the stage operator ($match, $group, $lookup, $project, $sort, $limit, $unwind, $search, etc.). BizFirst expressions are supported in stage values. |
// aggregate — daily revenue by product category
{
"credential_id": "mongodb-atlas-prod",
"resource": "document",
"operation": "aggregate",
"database": "ecommerce",
"collection": "orders",
"pipeline": [
{ "$match": { "status": "completed", "order_date": { "$gte": "{{ vars.period_start }}", "$lte": "{{ vars.period_end }}" } } },
{ "$unwind": "$line_items" },
{ "$group": {
"_id": "$line_items.category",
"total_revenue": { "$sum": "$line_items.subtotal" },
"order_count": { "$sum": 1 },
"avg_order_value": { "$avg": "$line_items.subtotal" }
}},
{ "$sort": { "total_revenue": -1 } },
{ "$project": { "category": "$_id", "total_revenue": 1, "order_count": 1, "avg_order_value": 1, "_id": 0 } }
]
}
Search Index Operations — Properties
| Property | Required | Description |
index_name | Required | The Atlas Search index name. Required for create, update, and drop operations. |
index_definition | Optional | The index mapping definition as a JSON object. Required for create and update. Specifies analyzers and field mappings for full-text and vector search. |
Expression Support: All string-typed property values support BizFirst expression syntax using double curly braces: {{ expression }}. This enables dynamic database names, collection routing, filter values, and even dynamic pipeline stages at runtime. Use {{ vars.field }} for workflow variables, {{ env.VAR }} for environment variables, and {{ now() }} for the current timestamp.
Performance Note: Always include a limit on find operations targeting large collections. For production workloads, ensure query filters use indexed fields. Use the aggregate pipeline with $match as the first stage to leverage indexes before any transformation stages.