0
TL;博士希望从排序AWS API网关排序/顺序AWS API网关输出
API输出我有一个dynamoDB表 'NP' 与关键 'ID' 和GSI 'atype的指数'。没有排序键。
另外,我有API网关映射模板
{
"TableName": "NP",
"IndexName": "atype-index",
"KeyConditionExpression": "atype = :v1",
"ExpressionAttributeValues": {
":v1": {
"S": "$input.params('atype')"
}
}
}
映射模板将提取表中的所有值与GSI键指定的字符串匹配。但是,这些值没有特定的顺序提取,例如,该API可以是:
{
"Count": 3,
"Items": [
{
"apiUrl": {
"S": “ee”
},
"webTitle": {
"S": “dd”
},
"atype": {
"S": “type”
},
"id": {
"S": "1a"
}
},
{
"apiUrl": {
"S": “dd”
},
"webTitle": {
"S": “cc”
},
"atype": {
"S": "atype"
},
"id": {
"S": “3a”
}
},
{
"apiUrl": {
"S": “cc”
},
"webTitle": {
"S": “bb”
},
"atype": {
"S": "atype"
},
"id": {
"S": “2a”
}
}
],
"ScannedCount": 3
}
如何排序的关键“apiURL”,例如上面的输出?