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

Convert objects to DynamoDB Maps for storage #92

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

danielpanzella
Copy link

Looks like the code for reading maps from DynamoDB was added recently, but it fails when storing nested objects. This seems to make it work for me.

@gregory
Copy link

gregory commented May 8, 2018

Dynamite will almost always comply with the latest DynamoDB spec on Amazon

Is this accurate @xiao @eduardoramirez ? :)

@eduardoramirez
Copy link
Contributor

hey @gregory, yes it should for the most part be compliant. Of course, there will be features that we don't use at Medium that are not implemented though.

} else {
throw new Error('Invalid dynamo set value. Type: ' + firstItemType + ', Value: ' + value[0])
}
} else if (typeof value == "object") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this condition to the top level switch?

@@ -24,7 +24,7 @@
"dependencies": {
"kew": "0.7.0",
"typ": "0.6.3",
"aws-sdk": "2.2.47"
"aws-sdk": "2.5.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason here why we're updating the sdk?

Copy link
Author

@danielpanzella danielpanzella Aug 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, but this is something I did 2 years ago while implementing something for a former client, and I don't honestly recall the context here. If this PR is useful to others I can try and setup something to test it with the previous aws-sdk and see what happens, but I cannot promise when I will have time to do so.

Please consider this a response to all three of your questions.

@@ -90,6 +90,9 @@ function valueToObject(value) {
return {N: String(value)}
default:
if (Array.isArray(value)) {
if (value.length == 0)
return {L: []}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the implications here if the type of this list isn't of attributes?

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

Successfully merging this pull request may close these issues.

3 participants