扫描不存在的列表内的嵌套地图



我希望得到一些帮助,通过AWS CLI构建扫描,以获得"按需"扫描的结果。地图不存在。"on_demand"Map嵌套在其他父映射[0,1,2…]中。它们依次在播放列表列表中

扫描的条件将是is_offsite = true, video_type = OFFSITE,当然还有一个麻烦的条件是"on_demand"Map不存在

这是我的表结构。

{
"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"
}
},
"M": {
"duration": {
"N": "60"
},
"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
},
}
]
}

任何帮助都将是非常感激的。

这是通过使用以下命令完成的:

aws dynamodb scan 
--table-name table-name 
--projection-expression "id" 
--filter-expression 'is_offsite = :os AND video_type = :vt AND attribute_not_exists(playlist[0].on_demand)' 
--expression-attribute-values '{":os": { "BOOL": true},":vt": {"S": "OFFSITE"}}'