Skip to main content

NoSQL Databases

The NoSQL Databases node executes operations against MongoDB databases. It supports standard CRUD operations as well as aggregation queries, giving you full control over document-based data within your automation workflows.

Before You Use This Node

What you may needWhere to set it upWhy it matters
MongoDB connectionConnectionsSave database access once, then reuse it for every MongoDB action.
Common collection names, IDs, or filtersGlobal VariablesKeep repeated MongoDB values easy to maintain.
Reusable reference dataDatasetsKeep lookup data available for document workflows.

Actions

ActionDescription
nosql:mongodbExecute a MongoDB operation on a specified collection

nosql:mongodb

Performs a MongoDB operation. The specific operation is determined by the operation field in the configuration.

Parameters

ParameterTypeRequiredDescription
connectionIdstringYesID of the MongoDB connection
operationstringYesThe operation to perform: find, findOne, insertOne, insertMany, updateOne, updateMany, deleteOne, deleteMany, aggregate, countDocuments
collectionstringYesName of the MongoDB collection
queryobjectConditionalQuery filter document (required for find, update, delete operations)
documentobjectConditionalDocument to insert (required for insert operations)
documentsarrayConditionalArray of documents (required for insertMany)
updateobjectConditionalUpdate operations document (required for update operations)
pipelinearrayConditionalAggregation pipeline stages (required for aggregate)
sortobjectNoSort specification (e.g., {"createdAt": -1})
limitintegerNoMaximum documents to return
skipintegerNoNumber of documents to skip
projectionobjectNoFields to include or exclude (e.g., {"name": 1, "_id": 0})

Example: Find Documents

Example: Insert One Document

Example: Update Many Documents

Example: Aggregation Pipeline

Example: Delete Documents

Connection Types

The connection string format determines how the driver connects to MongoDB:

  • Standard MongoDB: mongodb://host:27017 -- connects to a single MongoDB instance or standalone server.
  • MongoDB Atlas (cloud): mongodb+srv://cluster.mongodb.net -- uses DNS seed list discovery for Atlas clusters.
  • Replica set: mongodb://host1:27017,host2:27017,host3:27017/?replicaSet=myRS -- connects to a replica set with automatic failover.

Set the appropriate connection string in the url field of the connection configuration.

Bulk Operations

  • Use insertMany for batch inserts. It is significantly more efficient than calling insertOne multiple times because it sends all documents in a single network round-trip.
  • Use updateMany to update all documents matching a filter in one operation.
  • For very large bulk operations (thousands of documents), consider splitting them into smaller batches to avoid step timeout. For example, insert 500 documents per step rather than 10,000 at once.

Common Problems

SymptomLikely CauseFix
Connection failedIncorrect URL, network issue, or IP not whitelistedVerify the url field. For Atlas, ensure the automation server's IP is in the Atlas IP Access List
Authentication failedWrong credentials or incorrect authSourceCheck username, password, and authSource (defaults to admin)
Collection not foundMisspelled collection name or wrong caseMongoDB collection names are case-sensitive. Verify the exact name
Query timeoutMissing indexes or large result setAdd indexes on frequently queried fields. Use limit and projection to reduce the response size
Document too largeDocument exceeds 16 MBMongoDB enforces a 16 MB document size limit. Split large documents or store large payloads in GridFS

Connection

Requires a MongoDB connection configured in the Global Configurator:

FieldDescription
urlMongoDB connection string (e.g., mongodb://host:27017 or mongodb+srv://...)
databaseDatabase name
usernameDatabase user (if authentication is enabled)
passwordDatabase password
authSourceAuthentication database. Defaults to admin

Configure under Connections > MongoDB in the Global Configurator.

Output

find / findOne

insertOne / insertMany

updateOne / updateMany

deleteOne / deleteMany

aggregate