Blocks

MongoDB

Connect and interact with MongoDB databases

Query, insert, update, and delete documents in MongoDB collections with support for complex queries and aggregations.

Back to Catalog
Toolsmongodb

Block Preview

MongoDB

Connect and interact with MongoDB databases

Usage

  1. Add the block to your workflow and connect it to the upstream step.
  2. Configure any required credentials or tokens in the inputs.
  3. Fill in required inputs and optional parameters for the run.
  4. Run a test execution, inspect outputs, and iterate before deploying.
  5. Deploy the mongodb block with monitoring enabled in production.

Inputs (UI)

Connection String

short-input

Placeholder: mongodb://username:password@host:port/database

Layout: full

Database

short-input

Placeholder: Enter database name

Layout: half

Collection

short-input

Placeholder: Enter collection name

Layout: half

Operation

dropdown

Layout: full

Options: Find Documents, Find One Document, Insert One Document, Insert Many Documents

Query Filter

code

Placeholder: { "field": "value" }

Layout: full

Condition: operation = ["find","findOne","updateOne","updateMany","deleteOne","deleteMany","count"]

Document

code

Placeholder: { "field1": "value1", "field2": "value2" }

Layout: full

Condition: operation = ["insertOne"]

Documents

code

Placeholder: [ { "field1": "value1" }, { "field1": "value2" } ]

Layout: full

Condition: operation = ["insertMany"]

Update

code

Placeholder: { "$set": { "field": "new value" } }

Layout: full

Condition: operation = ["updateOne","updateMany"]

Options

code

Placeholder: { "sort": { "field": 1 }, "limit": 10, "skip": 0 }

Layout: full

Condition: operation = ["find"]

Aggregation Pipeline

code

Placeholder: [ { "$match": { "field": "value" } }, { "$group": { "_id": "$field", "count": { "$sum": 1 } } } ]

Layout: full

Condition: operation = ["aggregate"]

Inputs (API)

connectionString

string

Required

database

string

Required

collection

string

Required

operation

string

Required

query

json

Optional

document

json

Optional

documents

json

Optional

update

json

Optional

options

json

Optional

pipeline

json

Optional

Outputs

Primary response type:

{
  "success": "boolean",
  "result": "json",
  "count": "number",
  "error": "string"
}

Tool Access

mongodb
MongoDB | NowFlow Blocks