Faraz
Faraz

Reputation: 6265

Dynamodb scan items by presence of a Document Type Map.AttributeName

I have this Item structure:

{
    "Items": [
        {
            "serviceName": {
                "S": "B"
            },
            "sharedData": {
                "M": {
                    "five": {
                        "S": "5"
                    }
                }
            }
        }
}

I want to scan data by the presence of key five "five" within sharedData map. Something like sharedData.five exists or sharedData.five == *.

Is this possible?

Upvotes: 1

Views: 197

Answers (1)

F_SO_K
F_SO_K

Reputation: 14829

aws dynamodb scan --table-name YOURTABLE --filter-expression 'attribute_exists(sharedData.five)'

Here is the CLI answer. You will need to turn it into Java, which is simple enough.

Upvotes: 3

Related Questions