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

Method ZSCORE

sorted_sets.go:474–490  ·  view source on GitHub ↗
(key string, member string)

Source from the content-addressed store, hash-verified

472}
473
474func (c Client) ZSCORE(key string, member string) (score float64, found bool, err error) {
475 resp, err := c.ddbClient.GetItemRequest(&dynamodb.GetItemInput{
476 ConsistentRead: aws.Bool(c.consistentReads),
477 Key: keyDef{
478 pk: key,
479 sk: member,
480 }.toAV(c),
481 ProjectionExpression: aws.String(strings.Join([]string{c.skN}, ", ")),
482 TableName: aws.String(c.table),
483 }).Send(context.TODO())
484 if err == nil && len(resp.Item) > 0 {
485 found = true
486 score = zScoreFromAV(resp.Item[c.skN])
487 }
488
489 return
490}
491
492func (c Client) ZUNIONSTORE(destinationKey string, sourceKeys []string, aggregation ZAggregation, weights map[string]float64) (membersWithScores map[string]float64, err error) {
493 set, err := c.ZUNION(sourceKeys, aggregation, weights)

Callers 4

zRankMethod · 0.95
TestZBasicFunction · 0.80
TestZPopsFunction · 0.80
assertAbsenceFunction · 0.80

Calls 3

zScoreFromAVFunction · 0.85
toAVMethod · 0.45
StringMethod · 0.45

Tested by 3

TestZBasicFunction · 0.64
TestZPopsFunction · 0.64
assertAbsenceFunction · 0.64