MCPcopy
hub / github.com/redis/go-redis / CFAddNX

Method CFAddNX

probabilistic.go:572–577  ·  view source on GitHub ↗

CFAddNX adds an element to a Cuckoo filter only if it does not already exist in the filter. Returns true if the element was added to the filter or false if it already exists in the filter. For more information - https://redis.io/commands/cf.addnx/

(ctx context.Context, key string, element interface{})

Source from the content-addressed store, hash-verified

570// Returns true if the element was added to the filter or false if it already exists in the filter.
571// For more information - https://redis.io/commands/cf.addnx/
572func (c cmdable) CFAddNX(ctx context.Context, key string, element interface{}) *BoolCmd {
573 args := []interface{}{"CF.ADDNX", key, element}
574 cmd := NewBoolCmd(ctx, args...)
575 _ = c(ctx, cmd)
576 return cmd
577}
578
579// CFCount returns an estimate of the number of times an element may be in a Cuckoo Filter.
580// For more information - https://redis.io/commands/cf.count/

Callers

nothing calls this directly

Calls 1

NewBoolCmdFunction · 0.85

Tested by

no test coverage detected