| 472 | } |
| 473 | |
| 474 | func (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 | |
| 492 | func (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) |