2 回答

TA貢獻1966條經驗 獲得超4個贊
IndexName除了TableName之外,在創建QueryInput來查詢索引時還需要指定該屬性。
// The name of an index to query. This index can be any local secondary index
// or global secondary index on the table. Note that if you use the IndexName
// parameter, you must also provide TableName.
IndexName *string `min:"3" type:"string"`

TA貢獻1805條經驗 獲得超9個贊
var queryInput, err2 = svc.Query(&dynamodb.QueryInput{
TableName: aws.String(tableName),
IndexName: aws.String(index_name),
KeyConditions: map[string]*dynamodb.Condition{
"Phone": {
ComparisonOperator: aws.String("EQ"),
AttributeValueList: []*dynamodb.AttributeValue{
{
S: aws.String(phone_no),
},
},
},
},
})
- 2 回答
- 0 關注
- 224 瀏覽
添加回答
舉報