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

gefragt vor 3 Jahren2035 Aufrufe
1 Antwort
0

This was accomplished by using the following filter-expression

attribute_not_exists(playlist[0].on_demand)

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen