You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
constschema=newSchema({amount: BigInt,});// or with a default valueconstschema=newSchema({amount:{type: BigInt,default: 0n,},});
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.
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: