SADD
Syntax
SADD key member [member...]
Module
setCategories
fast set writeDescription
Add one or more members to the set. If the set does not exist, it's created.
Examples
- Go (Embedded)
- CLI
Add members to the set:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
cardinality, err := db.SAdd("key", "member1", "member2")
Add members to the set:
> SADD key member1 member2