summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/getex.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:34:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:34:44 +0000
commit02a04a2335701bfc8d6a1087338f58e9f37ceb52 (patch)
tree92c2c729cfdaaa3942a251357ff100e28a8b8624 /iredis/data/commands/getex.md
parentAdding upstream version 1.9.1. (diff)
downloadiredis-02a04a2335701bfc8d6a1087338f58e9f37ceb52.tar.xz
iredis-02a04a2335701bfc8d6a1087338f58e9f37ceb52.zip
Adding upstream version 1.9.4.upstream/1.9.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/getex.md')
-rw-r--r--iredis/data/commands/getex.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/iredis/data/commands/getex.md b/iredis/data/commands/getex.md
new file mode 100644
index 0000000..27dfc3d
--- /dev/null
+++ b/iredis/data/commands/getex.md
@@ -0,0 +1,28 @@
+Get the value of `key` and optionally set its expiration. `GETEX` is similar to
+`GET`, but is a write command with additional options.
+
+## Options
+
+The `GETEX` 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.
+- `EXAT` _timestamp-seconds_ -- Set the specified Unix time at which the key
+ will expire, in seconds.
+- `PXAT` _timestamp-milliseconds_ -- Set the specified Unix time at which the
+ key will expire, in milliseconds.
+- `PERSIST` -- Remove the time to live associated with the key.
+
+@return
+
+@bulk-string-reply: the value of `key`, or `nil` when `key` does not exist.
+
+@examples
+
+```cli
+SET mykey "Hello"
+GETEX mykey
+TTL mykey
+GETEX mykey EX 60
+TTL mykey
+```