Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AWS DynamoDB Metadata

Is there a way to add custom metadata on DynamoDB when performing such operations as PutItem, Query, Scan, GetItem, etc.? Where I can add and read those metadata?

Example:

"sample-key": "sample-value"

I think the S3 has the Metadata field on its UploadInput. While the SQS has the MessageSystemAttributeValue.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This is not possible in DynamoDB like how you do it in S3 or SQS.

For DynamoDB, you simply need to add an attribute to the item when you put/update it, in this case I call the attribute metadata:

  Item={
            'pk': 'jose.schneller@somewhere.com',
            'sk': 'engineer',
            'username': 'joses',
            'first_name': 'Jose',
            'last_name': 'Schneller',
            'name': 'Jose Schneller',
            'age': 27,
            'address': {
                'road': '12341 Fish Rd',
                'city': 'Freeland',
                'pcode': 98249,
                'state': 'WA',
                'country': 'USA'
            }, 
            'metadata':{
                'sample-key': 'sample-value'
            }
}

This means you get the items metadata each time you read the item.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading