keyv.update0.000005
Updates the value of a key.
Arguments
bucketrequired
The bucket to store the key under.key
The key to set a value for.value
The value to set.type
The type of value to set.expiry
When the key expires, given as a timestamp.ttl
The number of seconds until the key expires.Return Value
true
if the key was updated, otherwise false
.keyv.updated
is similar to keyv.set
, but does not create keys if they do not exist.
something went wrong :(
Updating a key with a new value
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: "mf8f4f15", value: "foo"
)
client.keyv.update.call(
bucket: "mf8f4f15", value: "bar"
)
client.keyv.set.call(
undefined, mf8f4f15
);
client.keyv.update.call(
undefined, mf8f4f15
);
curl "https://proc.run/keyv/set?bucket=mf8f4f15" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "foo"
curl "https://proc.run/keyv/update?bucket=mf8f4f15&value=bar" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
true
There's a lot more to the key-value store, including expiries and value types—learn more in the docs.
Stuck? Want to chat about an idea? Join the community on Discord.