keyv.ttl
0.000005

Gets the ttl of a key.

Arguments
bucketrequired
The bucket the key is stored under.
key
The key to get the ttl for.
Return Value
The ttl for the key in seconds with microsecond precision, or null if the key is not set to expire or does not exist.
something went wrong :(
Getting the ttl of a key
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.keyv.set.call(
  bucket: "wea26534", value: "foo", ttl: 60
)

client.keyv.ttl.call(
  bucket: "wea26534"
)
client.keyv.set.call(
  undefined, wea26534
);

client.keyv.ttl.call(
  undefined, wea26534
);
curl "https://proc.run/keyv/set?bucket=wea26534&ttl=60" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "foo"

curl "https://proc.run/keyv/ttl?bucket=wea26534" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
 

59.404855


Stuck? Want to chat about an idea? Join the community on Discord.