Skip to content

zUnion omits '-inf' / '+inf' weights. #336

Description

@fnukis

Redis accepts -inf and +inf when specifying weights for a zUnionStore command (zUnion in phpredis).

As far as I can tell, phpredis "zUnion" simply omits a weight when specified as as a string (i.e. "-inf" does not work).

This comes very handy when one would like to make a "zset-diff", by simply executing a zUnion against two sets, specifying weights "1, '-inf'" and then zRangeByScore to get the resulting diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions