Module Hub Beta

TOPK.SHRINK

key [k]

Resets the global offset after applying it to all members, trims size to k if specified and not zero.

Should be called periodically on TopK Sorted Sets to avoid loosing counts precision.

Return Value

String reply: “OK”.

Examples

redis> TOPK.ADD tk 3 foo bar baz
(integer) 3
redis> TOPK.ADD tk 3 foo bar
(integer) 0
redis> TOPK.ADD tk 3 qaz
(integer) -1
redis> TOPK.SHRINK tk 3
OK

© 2017 Redis Labs, Inc. All rights reserved.