Upstash Documentation

XDELEX

Extended delete for streams with reference control.
1 min read

The 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#

keystringrequired#

The key of the stream.

option'KEEPREF' | 'keepref' | 'DELREF' | 'delref' | 'ACKED' | 'acked'#

Optional deletion behavior (case-insensitive). When provided, must come before the IDs:

  • KEEPREF: Keep consumer group references
  • DELREF: Delete consumer group references
  • ACKED: Only acknowledge messages (don't delete)

If not provided, entries are deleted by default.

ids...string[]required#

One or more stream entry IDs to delete. When an option is provided, IDs must come after the option.

Response#

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
Note

This command is available in Redis 8.2.0 and later. It provides extended functionality compared to the standard XDEL command.