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

Method MSETNX

strings.go:159–161  ·  view source on GitHub ↗

MSETNX sets the given keys and values atomically in a transaction, but only if none of the given keys exist. If one or more of the keys already exist, nothing will be changed and MSETNX will return false. Works similar to https://redis.io/commands/msetnx

(data map[string]Value)

Source from the content-addressed store, hash-verified

157//
158// Works similar to https://redis.io/commands/msetnx
159func (c Client) MSETNX(data map[string]Value) (ok bool, err error) {
160 return c.mset(data, Flags{IfNotExists})
161}
162
163func (c Client) mset(data map[string]Value, flags Flags) (ok bool, err error) {
164 inputs := make([]dynamodb.TransactWriteItem, 0, len(data))

Callers 1

TestAtomicOpsFunction · 0.80

Calls 1

msetMethod · 0.95

Tested by 1

TestAtomicOpsFunction · 0.64