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

Method ZREM

sorted_sets.go:402–420  ·  view source on GitHub ↗
(key string, members ...string)

Source from the content-addressed store, hash-verified

400}
401
402func (c Client) ZREM(key string, members ...string) (removedMembers []string, err error) {
403 for _, member := range members {
404 resp, err := c.ddbClient.DeleteItemRequest(&dynamodb.DeleteItemInput{
405 Key: keyDef{pk: key, sk: member}.toAV(c),
406 ReturnValues: dynamodb.ReturnValueAllOld,
407 TableName: aws.String(c.table),
408 }).Send(context.TODO())
409
410 if err != nil {
411 return removedMembers, err
412 }
413
414 if len(resp.Attributes) > 0 {
415 removedMembers = append(removedMembers, member)
416 }
417 }
418
419 return
420}
421
422func (c Client) ZREMRANGEBYLEX(key string, min, max string) (removedMembers []string, err error) {
423 membersWithScores, err := c.ZRANGEBYLEX(key, min, max, 0, 0)

Callers 5

zPopMethod · 0.95
ZREMRANGEBYLEXMethod · 0.95
ZREMRANGEBYRANKMethod · 0.95
ZREMRANGEBYSCOREMethod · 0.95
TestZBasicFunction · 0.80

Calls 2

toAVMethod · 0.45
StringMethod · 0.45

Tested by 1

TestZBasicFunction · 0.64