diff --git a/boltease.go b/boltease.go index 38b657a..670e801 100644 --- a/boltease.go +++ b/boltease.go @@ -660,6 +660,19 @@ func (b *DB) AddToStringList(path []string, values ...string) error { return err } +func (b *DB) StringListContains(path []string, value string) (bool, error) { + list, err := b.GetStringList(path) + if err != nil { + return false, err + } + for i := range list { + if list[i] == value { + return true, nil + } + } + return false, nil +} + // GetKeyValueMap returns a map of all key/value pairs in the bucket at path func (b *DB) GetKeyValueMap(path []string) (map[string][]byte, error) { var err error