Open aaarichter opened 3 days ago
Wow I didn't even know bigint were a thing in DynamoDB 🤦♂️ Thanks for reaching out!
I have two ideas in mind:
number()
attributes as number | bigint
bigint()
atttribute type, that you could use in conjunction with anyOf
(anyOf(number(), bigint())
)I think it will depend on:
bigint
an extension of number
or are they something really different?bigint
be used for indexing?What do you think?
EDIT:
Well this definitely answers the question: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html#bigint 😅 Will have to create a new primitive
Actually, because DynamoDB doesn't really differ numbers
from bigint
, I'll with a number().big()
option to allow for big ints.
I'm using the dynamoDB geo library in combination with dynamoDB toolbox. The geo library is saving hash values like
5159980795834925053
in thegeohash
attribute. When I query the table entry, the geohash attribute value is returned asgeohash: 5159984851327668183n,
by the documentClient. Later in the queryCommand code, theformatter.format(item, { attributes })
function fails with the follow errorA similar issue occurs when putting an item with a large number. DynamoDB toolbox throws here as well