kokk.nik
kokk.nik

Reputation: 49

AWS DynamoDB find Item by key in Map attribute (not Partition key)

I have a table in DynamoDB where I want to get an Item not by the partition key but by a key in a Map attribute nested in the table.

{   
    "MyItem": { 
        "Key": "dfcwce",

        "NestedMap":
          {
          "map.key" : "value"
          "map.key2" : "value2"
          }
    }
}

I would like to query the item to get the Key of the item by the map.key.

Upvotes: 0

Views: 2439

Answers (1)

Dev1ce
Dev1ce

Reputation: 5944

Unfortunately, you can not query AWS Dynamodb without a Key field,
The Query operation finds items based on primary key values.
But you can query any table or secondary index that has a composite primary key (a partition key and a sort key).

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html

Upvotes: 1

Related Questions