* ZRem is a method belonging to ZSetStructure that removes a member from a ZSet. Parameters: - key (string): The key of the ZSet. - member (string): The member to be removed. Returns: - error: An error if the operation fails. The ZRem method checks for a non-empty key, retrieves the corresp
(key string, member string)
| 576 | the function will return the corresponding error. |
| 577 | */ |
| 578 | func (zs *ZSetStructure) ZRem(key string, member string) error { |
| 579 | if err := checkKey(key); err != nil { |
| 580 | return err |
| 581 | } |
| 582 | keyBytes := stringToBytesWithKey(key) |
| 583 | |
| 584 | zSet, err := zs.getZSetFromDB(keyBytes) |
| 585 | if err != nil { |
| 586 | return err |
| 587 | } |
| 588 | if err = zSet.RemoveNode(member); err != nil { |
| 589 | return err |
| 590 | } |
| 591 | return zs.setZSetToDB(keyBytes, zSet) |
| 592 | } |
| 593 | |
| 594 | // ZRems method removes one or more specified members from the sorted set that's stored under the provided key. |
| 595 | // Params: |
nothing calls this directly
no test coverage detected