-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
[FEATURE] BigInt support #1644
Comments
@andrew-sol Hmm. Any insight into how DynamoDB handles this? |
@fishcharlie DynamoDB supports 126-bits numbers. The following test runs as expected: import { marshall } from '@aws-sdk/util-dynamodb';
marshall({ value: 1000n }); // outputs: { value: { N: '1000' } } So it correctly converts bigints into numbers in dynamo. Max safe int in JS is 16 digits only. With Dynamoose I currently store 18+ digits numbers as strings. Today I needed to sort items by those values descending and it's not possible, because '102' is considered "greater" than '1001' when comparing strings. And I cannot store bigints with Dynamoose, even though DynamoDB supports them. |
Hi, it would be really cool to support this type, thanks for you work :) |
Summary:
Bigints are widely used in crypto projects and are natively supported by JS. Would be nice to see them in Dynamoose.
Currently we have to store long integers as strings and cast them back and forth for calculation/storage.
Code sample:
Schema
Model
General
Other:
The text was updated successfully, but these errors were encountered: