MongoDB
Connect to MongoDB database
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.
Execute find operation on MongoDB collection
Parameter | Type | Required | Description |
---|
host | string | Yes | MongoDB server hostname or IP address |
port | number | Yes | MongoDB server port (default: 27017) |
database | string | Yes | Database name to connect to |
username | string | No | MongoDB username |
password | string | No | MongoDB password |
authSource | string | No | Authentication database |
ssl | string | No | SSL connection mode (disabled, required, preferred) |
collection | string | Yes | Collection name to query |
query | string | No | MongoDB query filter as JSON string |
limit | number | No | Maximum number of documents to return |
sort | string | No | Sort criteria as JSON string |
Parameter | Type | Description |
---|
message | string | Operation status message |
documents | array | Array of documents returned from the query |
documentCount | number | Number of documents returned |
Insert documents into MongoDB collection
Parameter | Type | Required | Description |
---|
host | string | Yes | MongoDB server hostname or IP address |
port | number | Yes | MongoDB server port (default: 27017) |
database | string | Yes | Database name to connect to |
username | string | No | MongoDB username |
password | string | No | MongoDB password |
authSource | string | No | Authentication database |
ssl | string | No | SSL connection mode (disabled, required, preferred) |
collection | string | Yes | Collection name to insert into |
documents | array | Yes | Array of documents to insert |
Parameter | Type | Description |
---|
message | string | Operation status message |
documentCount | number | Number of documents inserted |
insertedId | string | ID of inserted document (single insert) |
insertedIds | array | Array of inserted document IDs (multiple insert) |
Update documents in MongoDB collection
Parameter | Type | Required | Description |
---|
host | string | Yes | MongoDB server hostname or IP address |
port | number | Yes | MongoDB server port (default: 27017) |
database | string | Yes | Database name to connect to |
username | string | No | MongoDB username |
password | string | No | MongoDB password |
authSource | string | No | Authentication database |
ssl | string | No | SSL connection mode (disabled, required, preferred) |
collection | string | Yes | Collection name to update |
filter | string | Yes | Filter criteria as JSON string |
update | string | Yes | Update operations as JSON string |
upsert | boolean | No | Create document if not found |
multi | boolean | No | Update multiple documents |
Parameter | Type | Description |
---|
message | string | Operation status message |
matchedCount | number | Number of documents matched by filter |
modifiedCount | number | Number of documents modified |
documentCount | number | Total number of documents affected |
insertedId | string | ID of inserted document (if upsert) |
Delete documents from MongoDB collection
Parameter | Type | Required | Description |
---|
host | string | Yes | MongoDB server hostname or IP address |
port | number | Yes | MongoDB server port (default: 27017) |
database | string | Yes | Database name to connect to |
username | string | No | MongoDB username |
password | string | No | MongoDB password |
authSource | string | No | Authentication database |
ssl | string | No | SSL connection mode (disabled, required, preferred) |
collection | string | Yes | Collection name to delete from |
filter | string | Yes | Filter criteria as JSON string |
multi | boolean | No | Delete multiple documents |
Parameter | Type | Description |
---|
message | string | Operation status message |
deletedCount | number | Number of documents deleted |
documentCount | number | Total number of documents affected |
Execute MongoDB aggregation pipeline
Parameter | Type | Required | Description |
---|
host | string | Yes | MongoDB server hostname or IP address |
port | number | Yes | MongoDB server port (default: 27017) |
database | string | Yes | Database name to connect to |
username | string | No | MongoDB username |
password | string | No | MongoDB password |
authSource | string | No | Authentication database |
ssl | string | No | SSL connection mode (disabled, required, preferred) |
collection | string | Yes | Collection name to execute pipeline on |
pipeline | string | Yes | Aggregation pipeline as JSON string |
Parameter | Type | Description |
---|
message | string | Operation status message |
documents | array | Array of documents returned from aggregation |
documentCount | number | Number of documents returned |
- Category:
tools
- Type:
mongodb