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

Function put3

examples/basic/main.go:126–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126func put3() {
127 if err := db.Update(
128 func(tx *nutsdb.Tx) error {
129 key := []byte("name2")
130 val := []byte("val2")
131 return tx.PutIfNotExists(bucket, key, val, 0)
132 }); err != nil {
133 log.Fatal(err)
134 }
135}
136
137func put4() {
138 if err := db.Update(

Callers 1

mainFunction · 0.85

Calls 2

UpdateMethod · 0.80
PutIfNotExistsMethod · 0.80

Tested by

no test coverage detected