Blocks
MongoDB
Connect and interact with MongoDB databases
Query, insert, update, and delete documents in MongoDB collections with support for complex queries and aggregations.
Block Preview
MongoDB
Connect and interact with MongoDB databases
Usage
- Add the block to your workflow and connect it to the upstream step.
- Configure any required credentials or tokens in the inputs.
- Fill in required inputs and optional parameters for the run.
- Run a test execution, inspect outputs, and iterate before deploying.
- Deploy the mongodb block with monitoring enabled in production.
Inputs (UI)
Connection String
short-inputPlaceholder: mongodb://username:password@host:port/database
Layout: full
Database
short-inputPlaceholder: Enter database name
Layout: half
Collection
short-inputPlaceholder: Enter collection name
Layout: half
Operation
dropdownLayout: full
Options: Find Documents, Find One Document, Insert One Document, Insert Many Documents
Query Filter
codePlaceholder: { "field": "value" }
Layout: full
Condition: operation = ["find","findOne","updateOne","updateMany","deleteOne","deleteMany","count"]
Document
codePlaceholder: { "field1": "value1", "field2": "value2" }
Layout: full
Condition: operation = ["insertOne"]
Documents
codePlaceholder: [ { "field1": "value1" }, { "field1": "value2" } ]
Layout: full
Condition: operation = ["insertMany"]
Update
codePlaceholder: { "$set": { "field": "new value" } }
Layout: full
Condition: operation = ["updateOne","updateMany"]
Options
codePlaceholder: { "sort": { "field": 1 }, "limit": 10, "skip": 0 }
Layout: full
Condition: operation = ["find"]
Aggregation Pipeline
codePlaceholder: [ { "$match": { "field": "value" } }, { "$group": { "_id": "$field", "count": { "$sum": 1 } } } ]
Layout: full
Condition: operation = ["aggregate"]
Inputs (API)
connectionString
stringRequired
database
stringRequired
collection
stringRequired
operation
stringRequired
query
jsonOptional
document
jsonOptional
documents
jsonOptional
update
jsonOptional
options
jsonOptional
pipeline
jsonOptional
Outputs
Primary response type:
{
"success": "boolean",
"result": "json",
"count": "number",
"error": "string"
}