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

Method CFAdd

probabilistic.go:562–567  ·  view source on GitHub ↗

CFAdd adds an element to a Cuckoo 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.add/

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

Source from the content-addressed store, hash-verified

560// Returns true if the element was added to the filter or false if it already exists in the filter.
561// For more information - https://redis.io/commands/cf.add/
562func (c cmdable) CFAdd(ctx context.Context, key string, element interface{}) *BoolCmd {
563 args := []interface{}{"CF.ADD", key, element}
564 cmd := NewBoolCmd(ctx, args...)
565 _ = c(ctx, cmd)
566 return cmd
567}
568
569// CFAddNX adds an element to a Cuckoo filter only if it does not already exist in the filter.
570// Returns true if the element was added to the filter or false if it already exists in the filter.

Callers

nothing calls this directly

Calls 1

NewBoolCmdFunction · 0.85

Tested by

no test coverage detected