MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / keyExistsInSortedSet

Method keyExistsInSortedSet

tx.go:426–436  ·  view source on GitHub ↗
(bucketId core.BucketId, key, value string)

Source from the content-addressed store, hash-verified

424}
425
426func (tx *Tx) keyExistsInSortedSet(bucketId core.BucketId, key, value string) bool {
427 if _, exist := tx.db.Index.SortedSet.exist(bucketId); !exist {
428 return false
429 }
430 newKey := key
431 if strings.Contains(key, SeparatorForZSetKey) {
432 newKey, _ = splitStringFloat64Str(key, SeparatorForZSetKey)
433 }
434 exists, _ := tx.db.Index.SortedSet.Idx[bucketId].ZExist(newKey, []byte(value))
435 return exists
436}
437
438func (tx *Tx) getEntryNewAddRecordCount(entry *core.Entry) (int64, error) {
439 var res int64

Callers 1

Calls 3

splitStringFloat64StrFunction · 0.85
existMethod · 0.80
ZExistMethod · 0.80

Tested by

no test coverage detected