New260+ blocks and 240+ tools are now fully documented
Tool

MongoDB Tools

Query and modify documents in a MongoDB collection through the Atlas Data API.

The MongoDB provider lets a workflow find, insert, update, and delete documents in a MongoDB collection over HTTP using the MongoDB Atlas Data API. Use these tools when you need to read or write application data stored in MongoDB Atlas without managing a native database driver.

Overview

PropertyValue
Providermongodb
Categorytools
AuthAPI Key (sent as the api-key request header; Atlas Data API key)

Operations

OperationTool IDDescription
Findmongodb_findFind documents in a MongoDB collection via the Atlas Data API
Insert onemongodb_insert_oneInsert a single document into a MongoDB collection via the Atlas Data API
Update onemongodb_update_oneUpdate a single document in a MongoDB collection via the Atlas Data API
Delete onemongodb_delete_oneDelete a single document from a MongoDB collection via the Atlas Data API

Configuration

All operations share the same connection parameters: dataApiUrl, apiKey, dataSource, database, and collection. The apiKey is a secret (your Atlas Data API key) and is sent in the api-key HTTP header. Each request is a POST to {dataApiUrl}/action/<action>.

mongodb_find

Calls POST {dataApiUrl}/action/find.

ParameterTypeRequiredDescription
dataApiUrlstringYesMongoDB Atlas Data API base URL, e.g. https://data.mongodb-api.com/app/{{appId}}/endpoint/data/v1
apiKeystringYesSecret. MongoDB Atlas Data API key (sent as the api-key header)
dataSourcestringYesThe cluster (data source) name
databasestringYesThe database name
collectionstringYesThe collection name
filterjsonNoMongoDB query filter document (defaults to {} — matches all)
limitnumberNoMaximum number of documents to return

mongodb_insert_one

Calls POST {dataApiUrl}/action/insertOne.

ParameterTypeRequiredDescription
dataApiUrlstringYesMongoDB Atlas Data API base URL, e.g. https://data.mongodb-api.com/app/{{appId}}/endpoint/data/v1
apiKeystringYesSecret. MongoDB Atlas Data API key (sent as the api-key header)
dataSourcestringYesThe cluster (data source) name
databasestringYesThe database name
collectionstringYesThe collection name
documentjsonYesThe document to insert

mongodb_update_one

Calls POST {dataApiUrl}/action/updateOne.

ParameterTypeRequiredDescription
dataApiUrlstringYesMongoDB Atlas Data API base URL, e.g. https://data.mongodb-api.com/app/{{appId}}/endpoint/data/v1
apiKeystringYesSecret. MongoDB Atlas Data API key (sent as the api-key header)
dataSourcestringYesThe cluster (data source) name
databasestringYesThe database name
collectionstringYesThe collection name
filterjsonNoMongoDB query filter selecting the document to update (defaults to {})
updatejsonNoMongoDB update document, e.g. { "$set": { ... } } (defaults to {})

mongodb_delete_one

Calls POST {dataApiUrl}/action/deleteOne.

ParameterTypeRequiredDescription
dataApiUrlstringYesMongoDB Atlas Data API base URL, e.g. https://data.mongodb-api.com/app/{{appId}}/endpoint/data/v1
apiKeystringYesSecret. MongoDB Atlas Data API key (sent as the api-key header)
dataSourcestringYesThe cluster (data source) name
databasestringYesThe database name
collectionstringYesThe collection name
filterjsonNoMongoDB query filter selecting the document to delete (defaults to {})

Outputs

All four operations return the same output shape.

mongodb_find

  • data (json) — The MongoDB Data API find result.
  • metadata (json) — Response metadata.

mongodb_insert_one

  • data (json) — The MongoDB Data API insertOne result.
  • metadata (json) — Response metadata.

mongodb_update_one

  • data (json) — The MongoDB Data API updateOne result.
  • metadata (json) — Response metadata.

mongodb_delete_one

  • data (json) — The MongoDB Data API deleteOne result.
  • metadata (json) — Response metadata.

YAML Example

mongodb_1:
  type: mongodb
  name: "MongoDB"
  inputs:
    operation: "mongodb_find"
    dataApiUrl: "https://data.mongodb-api.com/app/data-abcde/endpoint/data/v1"
    apiKey: "{{MONGODB_API_KEY}}"
    dataSource: "Cluster0"
    database: "myDatabase"
    collection: "users"
    filter: { "status": "active" }
    limit: 10
  connections:
    outgoing:
      - target: next-block-id

Tips

  • Auth setup: the apiKey is your MongoDB Atlas Data API key, sent in the api-key header — not a database username/password and not a connection string. Store it in an environment variable and reference it as {{MONGODB_API_KEY}}. You must enable the Data API in Atlas and copy the base URL into dataApiUrl.
  • dataSource is the cluster name (e.g. Cluster0), not the database — keep dataSource, database, and collection distinct.
  • filter defaults to {} (matches everything), so mongodb_update_one and mongodb_delete_one will act on an arbitrary matching document if you leave it empty — always pass a precise filter for writes. Likewise an empty filter on mongodb_find returns all documents (bounded by limit).
  • For mongodb_update_one, the update value must use MongoDB update operators, e.g. { "$set": { "status": "inactive" } }. Reference upstream block outputs with double-brace syntax, e.g. {{previousBlock.data}}.