dynamodb-toolbox
dynamodb-toolbox copied to clipboard
Map type entity attrs and schemas.
/Question Interested to know what you will be doing with the TODO regarding object schemas.
For example I am using data and pdata entity level map type attributes. The pdata will be an object that I want projected into the indexes and the data is for pretty much everything else.
Say I want to update the pdata object type with a single attribute and not overwrite the existing record then it would be nice to be able to do a:
const userDbObj = { pk: sub, sk: 'User', pdata: { $set: { 'address.town': 'timbuktoo' } } }
await User.update(userDbObj)
if the 'address' attr has on the pdata object has not already been created then an error is thrown.
Thanks for the lib.
Hi @edwardgale!
I'll need to look at this to see if it's a library issue or a DDB one (likely the former). If it's the former, then it can be solved in a few different ways, including defaulting paths that don't exist or creating schemas for map
s.
Thanks for the note, Jeremy