I'm using the aws-sdk
for NodeJS to interact with a DynamoDB table. This is my first look at DynamoDB.
When using a call like getItem()
or updateItem()
, the data structure includes types, like this:
{
'a': { S: 'My string' }
}
Is there any way to pass and receive these objects without the types..? So...
{
'a': 'My string'
}
Or, any helper functions already written that will convert objects to and from this format..?
const data = dbToObj({ 'a': { S: 'My string' } })
// { 'a': 'My string' }
So I could convert to it when populating call params, and convert from it when receiving data.
Trying to avoid accessing my data like:
const myData = data.Item.something.M.somethinElse.M.qwerty.S
I know I could write something myself, just wondering if anyone knows of functions/options already available that would do this. I couldn't find any.