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"
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
  • An interesting discussion on this subject: http://stackoverflow.com/questions/26718263/php-redis-is-there-a-way-to-store-php-object-in-redis-without-serializing-it - without a definite answer. – SergeyLebedev Jan 11 '17 at 20:17

1 Answers1

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)
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278