XDELEX command provides extended deletion capabilities for stream entries with additional control options. This is an enhanced version of XDEL with more advanced features for managing stream data.
Arguments
The key of the stream.
One or more stream entry IDs to delete.
Optional deletion behavior (case-insensitive):
KEEPREForkeepref: Keep consumer group referencesDELREFordelref: Delete consumer group referencesACKEDoracked: Only acknowledge messages (don’t delete)
Response
A list of integers indicating the result for each ID in the same order as provided.
Use Cases
- Stream Cleanup: Remove processed or expired stream entries
- Data Retention: Implement custom retention policies
- Error Handling: Delete corrupted or invalid stream entries
- Memory Management: Clean up streams to free memory
This command is available in Redis 8.2.0 and later. It provides extended functionality compared to the standard XDEL command.