Sim

MongoDB

Connect to MongoDB database

The MongoDB tool enables you to connect to a MongoDB database and perform a wide range of document-oriented operations directly within your agentic workflows. With flexible configuration and secure connection management, you can easily interact with and manipulate your data.

With the MongoDB tool, you can:

  • Find documents: Query collections and retrieve documents with the mongodb_query operation using rich query filters.
  • Insert documents: Add one or multiple documents to a collection using the mongodb_insert operation.
  • Update documents: Modify existing documents with the mongodb_update operation by specifying filter criteria and the update actions.
  • Delete documents: Remove documents from a collection using the mongodb_delete operation, specifying filters and deletion options.
  • Aggregate data: Run complex aggregation pipelines with the mongodb_execute operation to transform and analyze your data.

The MongoDB tool is ideal for workflows where your agents need to manage or analyze structured, document-based data. Whether it's processing user-generated content, managing app data, or powering analytics, the MongoDB tool streamlines your data access and manipulation in a secure, programmatic way.

Usage Instructions

Integrate MongoDB into the workflow. Can find, insert, update, delete, and aggregate data.

Tools

mongodb_query

Execute find operation on MongoDB collection

Input

ParameterTypeRequiredDescription
hoststringYesMongoDB server hostname or IP address
portnumberYesMongoDB server port (default: 27017)
databasestringYesDatabase name to connect to
usernamestringNoMongoDB username
passwordstringNoMongoDB password
authSourcestringNoAuthentication database
sslstringNoSSL connection mode (disabled, required, preferred)
collectionstringYesCollection name to query
querystringNoMongoDB query filter as JSON string
limitnumberNoMaximum number of documents to return
sortstringNoSort criteria as JSON string

Output

ParameterTypeDescription
messagestringOperation status message
documentsarrayArray of documents returned from the query
documentCountnumberNumber of documents returned

mongodb_insert

Insert documents into MongoDB collection

Input

ParameterTypeRequiredDescription
hoststringYesMongoDB server hostname or IP address
portnumberYesMongoDB server port (default: 27017)
databasestringYesDatabase name to connect to
usernamestringNoMongoDB username
passwordstringNoMongoDB password
authSourcestringNoAuthentication database
sslstringNoSSL connection mode (disabled, required, preferred)
collectionstringYesCollection name to insert into
documentsarrayYesArray of documents to insert

Output

ParameterTypeDescription
messagestringOperation status message
documentCountnumberNumber of documents inserted
insertedIdstringID of inserted document (single insert)
insertedIdsarrayArray of inserted document IDs (multiple insert)

mongodb_update

Update documents in MongoDB collection

Input

ParameterTypeRequiredDescription
hoststringYesMongoDB server hostname or IP address
portnumberYesMongoDB server port (default: 27017)
databasestringYesDatabase name to connect to
usernamestringNoMongoDB username
passwordstringNoMongoDB password
authSourcestringNoAuthentication database
sslstringNoSSL connection mode (disabled, required, preferred)
collectionstringYesCollection name to update
filterstringYesFilter criteria as JSON string
updatestringYesUpdate operations as JSON string
upsertbooleanNoCreate document if not found
multibooleanNoUpdate multiple documents

Output

ParameterTypeDescription
messagestringOperation status message
matchedCountnumberNumber of documents matched by filter
modifiedCountnumberNumber of documents modified
documentCountnumberTotal number of documents affected
insertedIdstringID of inserted document (if upsert)

mongodb_delete

Delete documents from MongoDB collection

Input

ParameterTypeRequiredDescription
hoststringYesMongoDB server hostname or IP address
portnumberYesMongoDB server port (default: 27017)
databasestringYesDatabase name to connect to
usernamestringNoMongoDB username
passwordstringNoMongoDB password
authSourcestringNoAuthentication database
sslstringNoSSL connection mode (disabled, required, preferred)
collectionstringYesCollection name to delete from
filterstringYesFilter criteria as JSON string
multibooleanNoDelete multiple documents

Output

ParameterTypeDescription
messagestringOperation status message
deletedCountnumberNumber of documents deleted
documentCountnumberTotal number of documents affected

mongodb_execute

Execute MongoDB aggregation pipeline

Input

ParameterTypeRequiredDescription
hoststringYesMongoDB server hostname or IP address
portnumberYesMongoDB server port (default: 27017)
databasestringYesDatabase name to connect to
usernamestringNoMongoDB username
passwordstringNoMongoDB password
authSourcestringNoAuthentication database
sslstringNoSSL connection mode (disabled, required, preferred)
collectionstringYesCollection name to execute pipeline on
pipelinestringYesAggregation pipeline as JSON string

Output

ParameterTypeDescription
messagestringOperation status message
documentsarrayArray of documents returned from aggregation
documentCountnumberNumber of documents returned

Notes

  • Category: tools
  • Type: mongodb
On this page

On this page

Start building today
Trusted by over 60,000 builders.
Build Agentic workflows visually on a drag-and-drop canvas or with natural language.
Get started