upstash / issues

Issue Tracker for Upstash
https://upstash.com
2 stars 0 forks source link

HGETALL not working with Deno Redis client #37

Closed hwclass closed 1 year ago

hwclass commented 1 year ago

While sending a command to an Upstash Redis store via Deno Redis client, as it was working successfully with a hset method like the following:

await redis.sendCommand("HSET", <HASH>, <KEY>, <VALUE>)

it does not seem working with HGETALL & just returning {"code":42}.

const reply = await redis.sendCommand("HGETALL", <HASH>)

As I was not sure if that's because of the library's internal problem or not, just wanted to make sure if that's an issue from Upstash side.

Thanks in advance.

chronark commented 1 year ago

@hwclass

const hgetall = await redis.hgetall("hash")

this works, please use that for now, while I try to figure out what's going on

not sure why the sendCommand returns this

Also if you want an edge friendly redis client, that works over HTTP, you can consider using https://deno.land/x/upstash_redis@v1.18.1

hwclass commented 1 year ago

@chronark Thanks for the tip & the additional info! will try it out...

Edit: Worked well & thanks again.

chronark commented 1 year ago

For anyone else encountering this: You need to call .value() on the response

const hgetall = await redis.sendCommand("HGETALL","hash")
console.log(hgetall.value())