nicolasff/phpredis — Issue #118: pipelining and zScore of unexisting element bug
Author: adammada
Created: 2012-01-19 16:01:52+00:00
State: open

Hi,

i have code in which i want to determine if n elements are in Sorted Set.

I can do:

$pipeline = $redis->multi( Redis::PIPELINE );
foreach( $target_keys as $id )
{
$pipeline->zRank( 'set' , $id );
}
$ret = $pipeline->exec();

and then check if false was returned. But i prefer to make:

$pipeline = $redis->multi( Redis::PIPELINE );
foreach( $target_keys as $id )
{
$pipeline->zScore( 'set' , $id );
}
$ret = $pipeline->exec();

cause zScore is faster than zRank. But it doesnt work, cause if element doesn't exists, $ret table dosent have any information. (no false, just no entry).