ZMPOP
Syntax
ZMPOP key [key ...] <MIN | MAX> [COUNT count]
Module
sortedsetCategories
write slow sortedsetDescription
Pop a 'count' elements from multiple sorted sets. MIN or MAX determines whether to pop elements with the lowest or highest scores respectively.
Examples
- Go (Embedded)
- CLI
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})
Pop a 'count' elements from multiple sorted sets:
> ZMPOP key1 key2 MIN COUNT 2