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
},
}
]
}

asked 3 years ago2014 views
1 Answer
0

This was accomplished by using the following filter-expression

attribute_not_exists(playlist[0].on_demand)

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions