Skip to content

EXPIRE deviates from REDIS documented return value (integer reply) #2387

Open
@rafak

Description

@rafak

Redis docs for the EXPIRE command state that it returns an "Integer reply"

in node-redis the response is transformed into a boolean.

// NOTE: r - instance of redis client

> r.set('aaa','888').then(console.log)
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 2924,
  [Symbol(trigger_async_id_symbol)]: 2920
}
> OK
> r.get('aaa').then(console.log)
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 2545,
  [Symbol(trigger_async_id_symbol)]: 2541
}
> 888
> r.expire('aaa', -11).then(console.log)
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 2718,
  [Symbol(trigger_async_id_symbol)]: 2714
}
> true      // <======= returns bool

Environment:

  • Node.js Version: v16.18.1
  • Redis Server Version: redis_version:6.2.6
  • Node Redis Version: redis@4.5.1
  • Platform: debian 10 buster (docker)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeBugEvaluatingThis ticket is still taken into consideration without a clear path forward.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions