question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Get Redis Key Value

See original GitHub issue

Hi -

Not sure what I am doing wrong but I cannot seem to get the Redis key value.

If I do something like:

  await redis.set('key', 'value',)
  const data = await redis.get('key')
  console.log(data)

I get back a hashed string like dmFsdWU=. How do I resolve this to the actual value (‘value’). I am using @upstash/redis in Nextjs api routes.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
chronarkcommented, Dec 14, 2022

Please try creating your redis instance like this:

new Redis({...., responseEncoding:false })

I’m investigating this problem right now

can you tell me your redis version and runtime? also when did this start happening?

1reaction
chronarkcommented, Dec 19, 2022

Yes I just figured this out as well. thank you so much for reporting it.

I’ll be working on a fix for nodejs14 but in the meantime you need to either use responseEncoding: false or upgrade to at least node v16 @btahir @anishsrinivasan

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not get key value from Redis in Express js - Stack Overflow
I have a node express application running on localhost:3500 on windows 10 . I am using redis for storing refresh tokens .
Read more >
How to Get All Keys in Redis | Tutorial by Chartio
Most (But Not All) Objects Use a Key​​ For the vast majority of data storage with Redis, data will be stored in a...
Read more >
client.get return undefined even tho key value exists #1783
client. get return undefined even tho key value exists · Issue #1783 · redis/node-redis · GitHub.
Read more >
Redis - A Key/Value Store - UVA Research Computing
As a dictionary, Redis allows you to set and retrieve pairs of keys and values. Think of a “key” as a unique identifier...
Read more >
Redis - npm
A modern, high performance Redis client. Latest version: 4.5.1, last published: a month ago. Start using redis in your project by running ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found