Create and change a key
Create a key, edit its value, set or remove a TTL and rename it.
In short
Create a key, change its value, set or remove its time to live, or rename it - on any connection that is not read-only. Every edit is one line in the audit trail, and there is no undo.
Before you start
- Who: changing keys needs Edit on the connection, and the connection must not be read-only or Production.
- Plan: each save, delete, flush and writing command counts as one command against your plan (see the limits in Good to know).
- First: scan for the key. A cache has no undo, so read the value before you change it.
Change a key
- Open the key from the Keys tab.
- Use the controls for its type (see the table) and save.
- To set a time to live, type seconds in Seconds (3600 is one hour) and press "Set TTL". "Remove TTL" makes the key permanent.
- To rename, press "Rename", type the new name and press "Rename" again.
Rename overwrites If a key with the new name exists, the server replaces it and its old value is lost. Scan for the new name first.
Create a key
- On the Keys tab press "New key" and type the key name, for example user:42.
- Choose the "Type": String, Hash, List, Set or Sorted set.
- Fill in the first value - for a hash also the first field, for a sorted set also the score.
- For a string, optionally enter a TTL in seconds; leave it blank for no expiry.
- Press "Create key". The list rescans and the new key opens.
Good to know
- Each save, delete, flush and writing command counts as one command against your plan. Free allows 100 an hour and 1,000 a day. Pro and Business allow 1,000 an hour and 5,000 a day. Enterprise allows 10,000 an hour and 50,000 a day. Reads are free.
- Creating on an existing name: a string replaces the value; a hash, list, set or sorted set adds to a key of the same type.
- Streams are created from the Console.
- "Remove TTL" appears only while the key has an expiry.
Example A flag stays on for one customer on Staging. Scan flags:customer:*, open the hash, Edit new_checkout to false, then set a TTL of 3600 so the next stale copy clears itself.
If something goes wrong
- Wrong key type: the name holds another type. Pick another name or delete the old key first.
- "Production connections are read-only" / "Connection … is read-only.": edits are refused there.
- "Writing to a cache is not included in your plan."
- A plan limit message: the hourly or daily commands are used up; it says when more are available.
Related
- /help/cache-tester/browsing-and-editing-keys
- /help/cache-tester/delete-keys
- /help/cache-tester/read-the-audit-trail