Skip to main content

ZMPOP

Syntax

ZMPOP key [key ...] <MIN | MAX> [COUNT count]

Module

sortedset

Categories

write slow sortedset

Description

Pop a 'count' elements from multiple sorted sets. MIN or MAX determines whether to pop elements with the lowest or highest scores respectively.

Examples

Pop a 'count' elements from multiple sorted sets:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
sortedSets, err := vault.ZMPop([]string{"key1", "key2"}, db.ZMPopOptions{Min: true, Count: 2})