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

Method HMSET

hashes.go:57–84  ·  view source on GitHub ↗
(key string, fieldValues map[string]Value)

Source from the content-addressed store, hash-verified

55}
56
57func (c Client) HMSET(key string, fieldValues map[string]Value) (err error) {
58 items := make([]dynamodb.TransactWriteItem, 0, len(fieldValues))
59
60 for field, v := range fieldValues {
61 builder := newExpresionBuilder()
62 builder.updateSET(vk, v)
63
64 items = append(items, dynamodb.TransactWriteItem{
65 Update: &dynamodb.Update{
66 ConditionExpression: builder.conditionExpression(),
67 ExpressionAttributeNames: builder.expressionAttributeNames(),
68 ExpressionAttributeValues: builder.expressionAttributeValues(),
69 Key: keyDef{
70 pk: key,
71 sk: field,
72 }.toAV(c),
73 TableName: aws.String(c.table),
74 UpdateExpression: builder.updateExpression(),
75 },
76 })
77 }
78
79 _, err = c.ddbClient.TransactWriteItemsRequest(&dynamodb.TransactWriteItemsInput{
80 TransactItems: items,
81 }).Send(context.TODO())
82
83 return
84}
85
86func (c Client) HMGET(key string, fields ...string) (values map[string]ReturnValue, err error) {
87 values = make(map[string]ReturnValue)

Callers 1

TestAtomicHashOpsFunction · 0.80

Calls 8

newExpresionBuilderFunction · 0.85
updateSETMethod · 0.80
conditionExpressionMethod · 0.80
updateExpressionMethod · 0.80
toAVMethod · 0.45
StringMethod · 0.45

Tested by 1

TestAtomicHashOpsFunction · 0.64