Sim

MongoDB

Connect to MongoDB database

Usage Instructions

Connect to any MongoDB database to execute queries, manage data, and perform database operations. Supports find, insert, update, delete, and aggregation operations with secure connection handling.

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
MongoDB