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

Method GetSet

tx_btree.go:247–254  ·  view source on GitHub ↗
(bucket string, key, value []byte)

Source from the content-addressed store, hash-verified

245}
246
247func (tx *Tx) GetSet(bucket string, key, value []byte) (oldValue []byte, err error) {
248 return oldValue, tx.update(bucket, key, func(b []byte) ([]byte, error) {
249 oldValue = b
250 return value, nil
251 }, func(oldTTL uint32) (uint32, error) {
252 return oldTTL, nil
253 })
254}
255
256// Has returns true if the record exists. It checks without retrieving the
257// value from disk making lookups significantly faster while keeping memory

Callers 4

txGetSetFunction · 0.80
getSetFunction · 0.80

Calls 1

updateMethod · 0.95

Tested by 3

txGetSetFunction · 0.64