WRONGTYPE Operation against a key holding the wrong kind of value Laravel

18,226

Could you please try this code sample and see if it works for you.

return $redis->HGETALL("doctor:8a772886-e7b2-442a-a0d5-621307510c6a");
Share:
18,226
Vipin Singh
Author by

Vipin Singh

Working on Open Source Technologies from more than 10 Years. My Skills are MySQL, PgSQL, Mongodb Database Administrator, Web Technologies : Angular, PHP, JavaScript Programming: Python, Ruby Others : Web Scraping, Data Analysis, Data Migration. Contact me at er.vipinsingh1atgmail.com

Updated on June 09, 2022

Comments

  • Vipin Singh
    Vipin Singh almost 2 years

    Hi I am using Laravel with Redis .When I am trying to access a key by get method then get following error "WRONGTYPE Operation against a key holding the wrong kind of value"

    I am using following code to access the key value -

    Route::get('/', function () {
    
        //$redis = app()->make("redis");
        $redis = Redis::connection();
    
        return $redis->get("doctor:8a772886-e7b2-442a-a0d5-621307510c6a");
    
    });