0

I am trying to add a SET of integers (sadd) via PHPRedis extension.

 $Client->sadd('key',1,2,3);

or
call_user_func_array([$Client,'sadd'],[1,2,3]);

In the monitor I get:

"SADD" "key" "i:1" "i:2" "i:3"`  

Which means it is serialized.
How do I do it so it is not serialized and inserted into Redis like if I do it from command line.
Monitor:

"SADD" "key" "1" "2" "3"
1

1 Answer 1

0

Seems it was some negligence on my part.
In my connection I set by default

$Redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);

So all I have to do is use in the connection code (which is the default)

$Redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.