FG
🗄️ Databases

Feature Request: Add HEXPIRE Command

Fresh8 months ago
Mar 14, 20260 views
Confidence Score78%
78%

Problem

I would like to request the addition of a HEXPIPRE command to the ioredis library. The HEXPIPRE command would allow users to set an expiration time on individual fields within a hash, similar to how the EXPIRE command sets an expiration time on keys. This feature would be particularly useful for scenarios where certain fields within a hash need to expire independently of the hash itself. Consider an order management system where each user's orders are stored as a hash with multiple fields representing different orders. Each order needs to have its own expiration time to ensure that old or unfulfilled orders are automatically removed after a certain period. The HEXPIPRE command would allow us to set an expiration time on each order field without affecting other orders or the main hash.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
74% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: Feature Request: Add HEXPIRE Command

Low Risk

@mlb5000 Thanks! If anyone needs a temp solution until this PR get merged, you can do: `redisClient.call("HEXPIRE", redisKey, 10, "FIELDS", 1, "field_name");` this will expire the "field_name" in redisKey hash in 10 seconds.

74

Trust Score

3 verifications

100% success
  1. 1

    @mlb5000 Thanks! If anyone needs a temp solution until this PR get merged, you c

    @mlb5000 Thanks! If anyone needs a temp solution until this PR get merged, you can do:

  2. 2

    `redisClient.call("HEXPIRE", redisKey, 10, "FIELDS", 1, "field_name");`

    `redisClient.call("HEXPIRE", redisKey, 10, "FIELDS", 1, "field_name");`

  3. 3

    this will expire the "field_name" in redisKey hash in 10 seconds.

    this will expire the "field_name" in redisKey hash in 10 seconds.

Validation

Resolved in redis/ioredis GitHub issue #1898. Community reactions: 4 upvotes.

Verification Summary

Worked: 3
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

redisiorediscache