TagCache.get() method
Returns data stored under given keys. If a single key provided returns a single result, otherwise it will return an array of results associated with the keys
Values are JSON-decoded on the way out, so what comes back is what was passed to TagCache.set(), not a string.
A redis failure is not thrown: it is logged as a warning and reported as null. That makes null ambiguous between "not cached" and "lookup failed", which is the right trade for a cache but means it must never be treated as proof that a value is absent.
Signature:
get(...keys: string[]): Promise<any | null | (any | null)[]>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
keys |
string[] |
one or more unprefixed keys to read |
Returns:
Promise<any | null | (any | null)[]>
the decoded value for a single key, an array of values in the order the keys were given for several, or null — per element for a miss, or as the whole result on error
Exceptions
TypeError when there is no redis connection — see REDIS_INIT_ERROR
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.