排序按字段去重
使用 lodash _.sortedUniqBy 为排序数组按字段去重
按属性路径对排序数组进行去重。
**亮点:**
- 使用 lodash `_.sortedUniqBy`
- 支持属性路径(如 `id`、`meta.key`)
- 返回 JSON 格式的结果
**示例:**
- 数组:`[{"id": 1}, {"id": 1}, {"id": 2}]`
- 路径:`id`
- 结果:`[{"id": 1}, {"id": 2}]`
API 文档
请求端点
POST /zh/api/tools/sorted-unique-by
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| array | textarea | 是 | 输入 JSON 数组 |
| path | text | 否 | 用于比较的属性路径 |
响应格式
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
文本:
文本
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-sorted-unique-by": {
"name": "sorted-unique-by",
"description": "使用 lodash _.sortedUniqBy 为排序数组按字段去重",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=sorted-unique-by",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。
如果遇见问题,请联系我们:[email protected]