Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipelining and zScore of unexisting element bug #118

Closed
adammada opened this issue Jan 19, 2012 · 1 comment
Closed

pipelining and zScore of unexisting element bug #118

adammada opened this issue Jan 19, 2012 · 1 comment

Comments

@adammada
Copy link

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).

nicolasff added a commit that referenced this issue Apr 29, 2012
@nicolasff
Copy link
Member

Hello,

I have added a unit test for your case and have found no issue. If you look at the changes in commit 00b5784 and print the contents of $ret after the call to exec(), you will see the last entry is false, as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants