Skip to main content

SADD

Syntax

SADD key member [member...]

Module

set

Categories

fast set write

Description

Add one or more members to the set. If the set does not exist, it's created.

Examples

Add members to the set:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
cardinality, err := db.SAdd("key", "member1", "member2")