Hands-on task
This task is step 17 of the course “Databases in an evening: SQLite, PostgreSQL, Redis”
Delete keys by pattern
Redis holds hundreds of keys with the cache: prefix (random names) and a few other keys. Delete all keys starting with cache:, leaving the rest untouched. Use a safe SCAN traversal (not KEYS).
Reference:redis-cli
What you'll practise:
- redis
- SCAN
- --pattern
- DEL
- key traversal