MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / SETNX

Method SETNX

strings.go:76–78  ·  view source on GitHub ↗

SETNX is equivalent to SET(key, value, Flags{IfNotExists}) Works similar to https://redis.io/commands/setnx

(key string, value Value)

Source from the content-addressed store, hash-verified

74//
75// Works similar to https://redis.io/commands/setnx
76func (c Client) SETNX(key string, value Value) (ok bool, err error) {
77 return c.SET(key, value, IfNotExists)
78}
79
80// GETSET gets the value at the key and atomically sets it to a new value.
81//

Callers 1

TestBasicFunction · 0.80

Calls 1

SETMethod · 0.95

Tested by 1

TestBasicFunction · 0.64