LLen returns the size of a list associated with a key. If the key does not exist, an error is returned.
(key string)
| 265 | // LLen returns the size of a list associated with a key. |
| 266 | // If the key does not exist, an error is returned. |
| 267 | func (l *ListStructure) LLen(key string) (int, error) { |
| 268 | // Get the list |
| 269 | lst, _, err := l.getListFromDB(key, false) |
| 270 | if err != nil { |
| 271 | return 0, err |
| 272 | } |
| 273 | |
| 274 | return lst.Length, nil |
| 275 | } |
| 276 | |
| 277 | // LRem removes elements from a list associated with a key based on the count and value parameters. |
| 278 | // The count can have the following values: |