Open
Description
Path: /redis/sdks/py/commands/string/get
Hi, I've failed to assess whether get does parse JSON or not from the docs:
async function getSession(sessionId: string) {
const redis = getRedis();
const maybeSession = (await redis.get(getSessionKey(sessionId))) as
| string
| null;
if (!maybeSession) {
// first input
return null;
}
// "JSON.parse" here will raise an error as you can't parse again a JSON object
return sessionSchema.parse(maybeSession);
}
The set method doc is more explicit about the fact that it handles the JSON.stringify call if it receives an object.
Metadata
Metadata
Assignees
Labels
No labels