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

Method VAddWithArgs

vectorset_commands.go:213–227  ·  vectorset_commands.go::cmdable.VAddWithArgs

`VADD key [REDUCE dim] (FP32 | VALUES num) vector element [CAS] [NOQUANT | Q8 | BIN] [EF build-exploration-factor] [SETATTR attributes] [M numlinks]` note: the API is experimental and may be subject to change.

(ctx context.Context, key, element string, val Vector, addArgs *VAddArgs)

Source from the content-addressed store, hash-verified

211// `VADD key [REDUCE dim] (FP32 | VALUES num) vector element [CAS] [NOQUANT | Q8 | BIN] [EF build-exploration-factor] [SETATTR attributes] [M numlinks]`
212// note: the API is experimental and may be subject to change.
213func (c cmdable) VAddWithArgs(ctx context.Context, key, element string, val Vector, addArgs *VAddArgs) *BoolCmd {
214 if addArgs == nil {
215 addArgs = &VAddArgs{}
216 }
217 args := []any{"vadd", key}
218 if addArgs.reduce() > 0 {
219 args = append(args, "reduce", addArgs.reduce())
220 }
221 args = append(args, val.Value()...)
222 args = append(args, element)
223 args = addArgs.appendArgs(args)
224 cmd := NewBoolCmd(ctx, args...)
225 _ = c(ctx, cmd)
226 return cmd
227}
228
229// `VCARD key`
230// note: the API is experimental and may be subject to change.

Callers 1

VAddMethod · 0.95

Calls 4

NewBoolCmdFunction · 0.85
reduceMethod · 0.80
ValueMethod · 0.65
appendArgsMethod · 0.45

Tested by

no test coverage detected