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

Method ARGrep

array_commands.go:304–311  ·  view source on GitHub ↗

ARGrep searches array elements in a range using textual predicates. Returns matching indexes only. Use ARGrepWithValues to also get the values.

(ctx context.Context, key string, start, end string, grepArgs *ARGrepArgs)

Source from the content-addressed store, hash-verified

302// ARGrep searches array elements in a range using textual predicates.
303// Returns matching indexes only. Use ARGrepWithValues to also get the values.
304func (c cmdable) ARGrep(ctx context.Context, key string, start, end string, grepArgs *ARGrepArgs) *UintSliceCmd {
305 args := make([]any, 4, 4+grepArgs.Len())
306 args[0], args[1], args[2], args[3] = "argrep", key, start, end
307 args = grepArgs.Append(args)
308 cmd := NewUintSliceCmd(ctx, args...)
309 _ = c(ctx, cmd)
310 return cmd
311}
312
313// ARGrepWithValues searches array elements in a range using textual predicates.
314// Returns matching indexes and their values as index-value pairs.

Callers

nothing calls this directly

Calls 3

NewUintSliceCmdFunction · 0.85
LenMethod · 0.65
AppendMethod · 0.65

Tested by

no test coverage detected