Skip to content

SET should accept more parameters #51

@BogdanCln

Description

@BogdanCln

Current implementation only has key and value as parameters for the SET method:

public set(key: string, value: string) { return this.command<string>("SET", key, value); }

Redis docs specify some extra options that might make commands such as setex deprecated in the future (https://redis.io/commands/set#options):

The SET command supports a set of options that modify its behavior:

EX seconds -- Set the specified expire time, in seconds.
PX milliseconds -- Set the specified expire time, in milliseconds.
NX -- Only set the key if it does not already exist.
XX -- Only set the key if it already exist.
KEEPTTL -- Retain the time to live associated with the key.
GET -- Return the old value stored at key, or nil when key did not exist.
Note: Since the SET command options can replace SETNX, SETEX, PSETEX, GETSET, it is possible that in future versions of > Redis these three commands will be deprecated and finally removed.

Command example:

redis> SET anotherkey "will expire in a minute" EX 60
"OK"

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuresThe new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions