Skip to content

Instantly share code, notes, and snippets.

@digitalbase
Created April 23, 2020 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalbase/9da93be2e1060641e95752ef59a5a506 to your computer and use it in GitHub Desktop.
Save digitalbase/9da93be2e1060641e95752ef59a5a506 to your computer and use it in GitHub Desktop.
const AWS = require('aws-sdk');
const { DocumentClient } = require('aws-sdk/clients/dynamodb');
module.exports = () => {
return new DocumentClient( {
// ensures empty values (userId = null) are converted
// more @ https://stackoverflow.com/questions/37479586/nodejs-with-dynamodb-throws-error-attributevalue-may-not-contain-an-empty-strin
convertEmptyValues: true
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment