upstash / issues

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

Redis - error: "WRONGTYPE Operation against a key holding the wrong kind of value" #24

Closed serkanserterSE closed 2 years ago

serkanserterSE commented 2 years ago

Hi. When I run the following code, I get an error, the data is in JSON type on Redis.

fetch("https://eu2-steady-wallaby-30045.upstash.io/get/W1", {
        headers: {
            Authorization: "Bearer *****"
        }
    }).then(response => response.json())
        .then(data => console.log(data));

ss

mdogan commented 2 years ago

Hi @serkanserterSE, get command can only be used for string entries. What's the type of your key: W1? You can query its type using https://eu2-steady-wallaby-30045.upstash.io/type/W1.

serkanserterSE commented 2 years ago

Thanks for your help. The type of key is "hash"

mdogan commented 2 years ago

get command doesn't support hash keys. See hash commands: https://redis.io/commands/?group=hash