MCPcopy Index your code
hub / github.com/ByteStorage/FlyDB / ZRem

Method ZRem

structure/zset.go:578–592  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

576the function will return the corresponding error.
577*/
578func (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:

Callers

nothing calls this directly

Calls 5

getZSetFromDBMethod · 0.95
setZSetToDBMethod · 0.95
checkKeyFunction · 0.85
stringToBytesWithKeyFunction · 0.85
RemoveNodeMethod · 0.80

Tested by

no test coverage detected