convertInput function in the dynamodb document client casting bigint to map.
See original GitHub issueConfirm by changing [ ] to [x] below to ensure that it’s a bug:
- [/] I’ve gone though Developer Guide and API reference
- [/] I’ve checked AWS Forums and StackOverflow for answers
- [/] I’ve searched for previous similar issues and didn’t find any solution
Describe the bug
The bug should loosely be called a bug, or perhaps a feature request. In the function convertInput
in the aws-sdk lib dynamodb converter.js it does not support BigInt data types. As of Node 10.x being supported with Lambdas, the BigInt data type is available to us in Node. The problem is simply, typeof(BigInt) does not evaluate to Number, or NumberValue. Instead it evaluates to ‘bigint’.
Is the issue in the browser/Node.js? Node JS for the aws-sdk > dynamodb > converter.js
If on Node.js, are you running this on AWS Lambda? Yes
Details of the browser/Node.js version Node 10.x
SDK version number AWS Lambda 10.x
To Reproduce (observed behavior) Try to store a BigInt data type from params using any of the aws-sdk dynmodb document client write functions. You’ll notice that the error states that it cannot parse an M. this is because the converter default is to try to cast it to a map rather than evaluating bigint as a number.
Expected behavior Have the converter function cast bigint to N data type as defined by the documentation. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBMapper.DataTypes.html
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
We’ve published Release Candidate for AWS SDK for JavaScript v3.
As part of the RC release, we’ve published utility functions for marshall and unmarshall operations in @aws-sdk/util-dynamodb which supports BigInt conversion. These utility functions can also be used with v2 as follows:
Hey @ajredniwja,
Thanks for following it up. I marked it as a bug report since AWS Lambda Node 10 support BigInt officially, but the SDK does not. That was my logic, I figured if you’re running tests for Node 10 and AWS supports Node 10 it was probably a miss when adding the node version support.
Either way, let me know if there is more I can do to help. Definitely need this functionality ASAP.
Thanks,