keyv.bytesize0.000005
Gets the bytesize of a key.
Arguments
bucketrequired
The bucket the key is stored under.key
The key to get the bytesize of.Return Value
The stored size of the key in bytes, or null if the key does not exist.keyv.bytesize
returns the same value used for billing and equals the sum of the key and value.
something went wrong :(
Getting the bytesize 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: "e29ab0a6", value: "foo"
)
client.keyv.bytesize.call(
bucket: "e29ab0a6"
)
client.keyv.set.call(
undefined, e29ab0a6
);
client.keyv.bytesize.call(
undefined, e29ab0a6
);
curl "https://proc.run/keyv/set?bucket=e29ab0a6" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "foo"
curl "https://proc.run/keyv/bytesize?bucket=e29ab0a6" --silent --request POST \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain"
13
Stuck? Want to chat about an idea? Join the community on Discord.