1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
【以下的回答经过翻译处理】 这个错误很可能是在GetItem
调用中发送了非主键属性导致的。当使用MarshalMap
时,它会在键对象中包括所有其他属性的空值。
你可以手动构建键,例如:
Key: map[string]*dynamodb.AttributeValue{
"userId": {
S: aws.String("2323"),
},
"username": {
S: aws.String("The Big New Movie"),
},
},
或者在结构体字段上添加omitempty
,当它们没有值时,将这些属性从编组映射中排除,例如:
type Movie struct {
Year int `json:"year,omitempty"`
Title string `json:"title,omitempty"`
[...]
}
Contenus pertinents
- demandé il y a 20 jours
- demandé il y a 8 mois
- demandé il y a 9 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans