Help with scan filter-expression to access data in a nested MAP.

0

Hi, I need to scan a DynamoDB table via AWS CLI and filter where a certain MAP (or field data within this MAP) do not exist.
This particular MAP named "on_demand" lives inside a MAP [0] which in turn live inside a List named "playlist".

The expected results would be items that do not have this "on_demand" MAP present.

Here is my data structure.
{
"Items": [
{
"playlist": {
"L": [
{
"M": {
"duration": {
"N": "46"
},
"on_demand": {
"M": {
"bucket": {
"S": "s3 Bucket"
},
"key": {
"S": "bucket url to video file"
}
}
},
"download": {
"M": {
"bucket": {
"S": "s3 bucket"
},
"key": {
"S": "bucket url to video file"
}
}
},
"status": {
"S": "on_demand"
}
}
}
]
},
"video_type": {
"S": "OFFSITE"
},
"id": {
"S": "random hash id"
},
"is_offsite": {
"BOOL": true
},
}
]
}

已提問 3 年前檢視次數 2033 次
1 個回答
0

This was accomplished by using the following filter-expression

attribute_not_exists(playlist[0].on_demand)

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南