MongoDB
连接 MongoDB 数据库
配置
查找文档
操作
查询文档
主机*
localhost or your.mongodb.host
端口*
27017
数据库名称*
your_database
用户名*
mongodb_user
密码*
••••••••
认证源
admin
SSL 模式
首选
集合名称*
users
查询过滤器 (JSON)
json
{"status": "active"}
限制
100
排序 (JSON)
json
{"createdAt": -1}
查询文档 (
mongodb_query)在 MongoDB 集合上执行查询操作
输入
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
host | string | 是 | MongoDB 服务器主机名或 IP 地址 |
port | number | 是 | MongoDB 服务器端口 (默认值:27017) |
database | string | 是 | 要连接的数据库名称 |
username | string | 否 | MongoDB 用户名 |
password | string | 否 | MongoDB 密码 |
authSource | string | 否 | 认证数据库 |
ssl | string | 否 | SSL 连接模式 (禁用, 必需, 首选) |
collection | string | 是 | 要查询的集合名称 |
query | string | 否 | 作为 JSON 字符串的 MongoDB 查询过滤器 |
limit | number | 否 | 返回的最大文档数量 |
sort | string | 否 | 作为 JSON 字符串的排序条件 |
输出
| 参数 | 类型 | 描述 |
|---|---|---|
message | string | 操作状态消息 |
documents | array | 查询返回的文档数组 |
documentCount | number | 返回的文档数量 |
插入文档
操作
插入文档
主机*
localhost or your.mongodb.host
端口*
27017
数据库名称*
your_database
用户名*
mongodb_user
密码*
••••••••
认证源
admin
SSL 模式
首选
集合名称*
users
文档(JSON 数组)*
json
[{"name": "John Doe", "email": "john@example.com", "status": "active"}]
插入文档 (
mongodb_insert)将文档插入 MongoDB 集合
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | string | 是 | MongoDB 服务器主机名或 IP 地址 |
port | number | 是 | MongoDB 服务器端口 (默认:27017) |
database | string | 是 | 要连接的数据库名称 |
username | string | 否 | MongoDB 用户名 |
password | string | 否 | MongoDB 密码 |
authSource | string | 否 | 认证数据库 |
ssl | string | 否 | SSL 连接模式 (disabled, required, preferred) |
collection | string | 是 | 要插入的目标集合名称 |
documents | array | 是 | 要插入的文档数组 |
输出
| 参数 | 类型 | 描述 |
|---|---|---|
message | string | 操作状态消息 |
documentCount | number | 插入的文档数量 |
insertedId | string | 插入文档的 ID (单次插入) |
insertedIds | array | 插入的文档 ID 数组 (多次插入) |
更新文档
操作
更新文档
主机*
localhost or your.mongodb.host
端口*
27017
数据库名称*
your_database
用户名*
mongodb_user
密码*
••••••••
认证源
admin
SSL 模式
首选
集合名称*
users
筛选条件 (JSON)*
json
{"name": "Alice Test"}
更新内容 (JSON)*
json
{"$set": {"name": "Jane Doe", "email": "jane@example.com"}}
更新插入
否
更新多条
否
更新文档 (
mongodb_update)更新 MongoDB 集合中的文档
输入
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
host | string | 是 | MongoDB 服务器主机名或 IP 地址 |
port | number | 是 | MongoDB 服务器端口 (默认:27017) |
database | string | 是 | 要连接的数据库名称 |
username | string | 否 | MongoDB 用户名 |
password | string | 否 | MongoDB 密码 |
authSource | string | 否 | 认证数据库 |
ssl | string | 否 | SSL 连接模式 (disabled、required、preferred) |
collection | string | 是 | 要更新的集合名称 |
filter | string | 是 | JSON 字符串格式的筛选条件 |
update | string | 是 | JSON 字符串格式的更新操作 |
upsert | boolean | 否 | 未找到时创建文档 |
multi | boolean | 否 | 更新多个文档 |
输出
| 参数 | 类型 | 描述 |
|---|---|---|
message | 字符串 | 操作状态消息 |
matchedCount | 数字 | 筛选器匹配的文档数量 |
modifiedCount | 数字 | 修改的文档数量 |
documentCount | 数字 | 受影响的文档总数 |
insertedId | 字符串 | 插入文档的 ID (如果 upsert) |
删除文档
操作
删除文档
主机*
localhost 或 your.mongodb.host
端口*
27017
数据库名称*
your_database
用户名*
mongodb_user
密码*
••••••••
认证源
admin
SSL 模式
首选
集合名称*
users
筛选器 (JSON)*
json
{"status": "inactive"}
删除多个
否
删除文档(
mongodb_delete)从 MongoDB 集合中删除文档
输入
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
host | 字符串 | 是 | MongoDB 服务器主机名或 IP 地址 |
port | 数字 | 是 | MongoDB 服务器端口 (默认:27017) |
database | 字符串 | 是 | 要连接的数据库名称 |
username | 字符串 | 否 | MongoDB 用户名 |
password | 字符串 | 否 | MongoDB 密码 |
authSource | 字符串 | 否 | 认证数据库 |
ssl | 字符串 | 否 | SSL 连接模式 (禁用、必需、首选) |
collection | 字符串 | 是 | 要删除的集合名称 |
filter | 字符串 | 是 | 以 JSON 字符串表示的筛选条件 |
multi | 布尔值 | 否 | 删除多个文档 |
输出
| 参数 | 类型 | 描述 |
|---|---|---|
message | 字符串 | 操作状态消息 |
deletedCount | 数字 | 已删除的文档数 |
documentCount | 数字 | 受影响的文档总数 |
聚合管道
操作
聚合管道
主机*
localhost 或 your.mongodb.host
端口*
27017
数据库名称*
您的数据库
用户名*
mongodb_user
密码*
••••••••
认证来源
admin
SSL 模式
首选
集合名称*
users
聚合管道(JSON 数组)*
json
[{"$group": {"_id": "$status", "count": {"$sum": 1}}}]
聚合管道(
mongodb_execute)执行 MongoDB 聚合管道
输入
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
host | 字符串 | 是 | MongoDB 服务器主机名或 IP 地址 |
port | 数字 | 是 | MongoDB 服务器端口 (默认:27017) |
database | 字符串 | 是 | 要连接的数据库名称 |
username | 字符串 | 否 | MongoDB 用户名 |
password | 字符串 | 否 | MongoDB 密码 |
authSource | 字符串 | 否 | 认证数据库 |
ssl | 字符串 | 否 | SSL 连接模式 (disabled, required, preferred) |
collection | 字符串 | 是 | 执行管道所用的集合名称 |
pipeline | 字符串 | 是 | JSON 字符串形式的聚合管道 |
输出
| 参数 | 类型 | 说明 |
|---|---|---|
message | 字符串 | 操作状态消息 |
documents | 数组 | 聚合返回的文档数组 |
documentCount | 数字 | 返回的文档数量 |
使用说明
将 MongoDB 集成到工作流中。可查找、插入、更新、删除和聚合数据。
说明
- 类别:
tools - 类型:
mongodb