Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map type entity attrs and schemas. #46

Open
edwardgale opened this issue May 11, 2020 · 1 comment
Open

Map type entity attrs and schemas. #46

edwardgale opened this issue May 11, 2020 · 1 comment
Labels
question Further information is requested

Comments

@edwardgale
Copy link

edwardgale commented May 11, 2020

/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.

@jeremydaly jeremydaly added the question Further information is requested label May 11, 2020
@jeremydaly
Copy link
Owner

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 maps.

Thanks for the note,
Jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants