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

Fix DynamoDB DocumentClient set unmarshalling #2647

Merged
merged 4 commits into from
Apr 30, 2019
Merged

Fix DynamoDB DocumentClient set unmarshalling #2647

merged 4 commits into from
Apr 30, 2019

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Apr 26, 2019

  • npm run test passes
  • changelog is added, npm run add-change

Using the DynamoDB DocumentClient, a set within an item will get stringified improperly:

const AWS = require('aws-sdk');
const client = new AWS.DynamoDB.DoclumentClient();
const params = {
  TableName: 'myTable',
  Key: {
    id: 1
  }
}
client.get(params, function(err,data) {
  if (!err) {
    console.log(JSON.stringify(data)); // {"Item":{"id":1,"list1":{"wrapperName":"Set","values":[1,5,9],"type":"Number"}}}
  }
}

Instead, only the values of the set should be returned:

console.log(JSON.stringify(data)); // {"Item":{"id":55,"list1":[1,5,9]}}

@srchase srchase changed the title Fix dynamodb set unmarshalling Fix DynamoDB DocumentClient set unmarshalling Apr 26, 2019
@codecov-io
Copy link

codecov-io commented Apr 29, 2019

Codecov Report

Merging #2647 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2647      +/-   ##
==========================================
+ Coverage   96.83%   96.83%   +<.01%     
==========================================
  Files         283      283              
  Lines        8615     8618       +3     
  Branches     1640     1640              
==========================================
+ Hits         8342     8345       +3     
  Misses        273      273
Impacted Files Coverage Δ
lib/dynamodb/set.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2201ba...c722d5a. Read the comment docs.

Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚢

@srchase srchase merged commit b6d3eba into aws:master Apr 30, 2019
@srchase srchase deleted the fix-dynamodb-set-unmarshalling branch April 30, 2019 15:11
@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants