ZDIFFSTORE

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Compute the difference set and store it in a new set

Usage: zdiff 2 src_key1 src_key2.
The result set is stored in dest_key.
Each member score is added by default if not specified.

src_key1 ={ (1,A),(2,B),(3,C)}
src_key2 = {(4,B),(5,C)(6,D)}
ZDIFFSTORE dest_key ={ (1,A)}

Example

Command>zdiffstore 2 src_key1 src_key2 withscores
Result> 1) "A"
2) "1"


Syntax

ZDIFFSTORE destination numkeys key [key ...]

  • Available since version 6.2.0.
  • Time complexity is O(L + (N-K)log(N)).
Related commands ZUNION, ZINTER

<< ZINTERSTORE ZDIFFSTORE ZSCAN >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.