hash_del
Remove specified fields from a Redis hash key using this tool. Input the hash key and field(s) to delete, streamlining data management in Redis databases.
Instructions
删除哈希字段
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | 要删除的字段名或字段名数组 | |
| key | Yes | 哈希键名 |
Implementation Reference
- src/services/mcpService.ts:990-1002 (handler)The handler function for the 'hash_del' tool. It ensures Redis connection, calls hdel on the Redis service with key and fields, and returns the result as JSON text.private async handleHashDel(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.hdel(args.key, args.fields); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
- src/services/mcpService.ts:248-267 (schema)Input schema definition for the 'hash_del' tool, specifying required parameters 'key' (string) and 'fields' (string or array of strings). Part of the tool registration in listTools.name: 'hash_del', description: '删除哈希字段', inputSchema: { type: 'object', properties: { key: { type: 'string', description: '哈希键名' }, fields: { oneOf: [ { type: 'string', description: '字段名' }, { type: 'array', items: { type: 'string' }, description: '字段名数组' } ], description: '要删除的字段名或字段名数组' } }, required: ['key', 'fields'] }
- src/services/mcpService.ts:654-655 (registration)Switch case in the MCP tool request handler that routes 'hash_del' calls to the handleHashDel method.case 'hash_del': return await this.handleHashDel(args);