Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

redis

laravel

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");

});
like image 389
Vipin Singh Avatar asked Jan 27 '16 12:01

Vipin Singh


1 Answers

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

return $redis->HGETALL("doctor:8a772886-e7b2-442a-a0d5-621307510c6a");
like image 65
Dhananjay Kashyap Avatar answered Sep 19 '22 11:09

Dhananjay Kashyap