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

Method HDEL

hashes.go:115–135  ·  view source on GitHub ↗
(key string, fields ...string)

Source from the content-addressed store, hash-verified

113}
114
115func (c Client) HDEL(key string, fields ...string) (deletedFields []string, err error) {
116 for _, field := range fields {
117 resp, err := c.ddbClient.DeleteItemRequest(&dynamodb.DeleteItemInput{
118 Key: keyDef{
119 pk: key,
120 sk: field,
121 }.toAV(c),
122 ReturnValues: dynamodb.ReturnValueAllOld,
123 TableName: aws.String(c.table),
124 }).Send(context.TODO())
125 if err != nil {
126 return deletedFields, err
127 }
128
129 if len(resp.Attributes) > 0 {
130 deletedFields = append(deletedFields, field)
131 }
132 }
133
134 return
135}
136
137func (c Client) HEXISTS(key string, field string) (exists bool, err error) {
138 resp, err := c.ddbClient.GetItemRequest(&dynamodb.GetItemInput{

Callers 1

TestBasicHashesFunction · 0.80

Calls 2

toAVMethod · 0.45
StringMethod · 0.45

Tested by 1

TestBasicHashesFunction · 0.64