Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SET should accept more parameters #51

Open
BogdanCln opened this issue Oct 25, 2020 · 0 comments
Open

SET should accept more parameters #51

BogdanCln opened this issue Oct 25, 2020 · 0 comments
Labels
features The new features

Comments

@BogdanCln
Copy link

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"

@dasoncheng dasoncheng added the features The new features label Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features The new features
Projects
None yet
Development

No branches or pull requests

2 participants