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

Method exists

structure/zset.go:549–561  ·  view source on GitHub ↗

exists checks if a given member with a specific score exists in a ZSet. It also verifies if the provided key is valid. The function returns a boolean value indicating whether the member with the specified score exists in the ZSet or not. Parameters: key (string): Specifies the key of the ZSet. s

(key string, score int, member string)

Source from the content-addressed store, hash-verified

547// exists in the ZSet or not. Returns false if the ZSet does not exist or if
548// the key is invalid.
549func (zs *ZSetStructure) exists(key string, score int, member string) bool {
550 if err := checkKey(key); err != nil {
551 return false
552 }
553 keyBytes := stringToBytesWithKey(key)
554
555 zSet, err := zs.getZSetFromDB(keyBytes)
556
557 if err != nil {
558 return false
559 }
560 return zSet.exists(score, member)
561}
562
563/*
564ZRem is a method belonging to ZSetStructure that removes a member from a ZSet.

Callers

nothing calls this directly

Calls 4

getZSetFromDBMethod · 0.95
checkKeyFunction · 0.85
stringToBytesWithKeyFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected