module Redis::Commands::Keys

def pexpire(key, milliseconds, nx: nil, xx: nil, gt: nil, lt: nil)

Returns:
  • (Boolean) - whether the timeout was set or not

Parameters:
  • options (Hash) --
  • milliseconds (Integer) -- time to live
  • key (String) --
def pexpire(key, milliseconds, nx: nil, xx: nil, gt: nil, lt: nil)
  args = [:pexpire, key, Integer(milliseconds)]
  args << "NX" if nx
  args << "XX" if xx
  args << "GT" if gt
  args << "LT" if lt
  send_command(args, &Boolify)
end