dynamodb icon indicating copy to clipboard operation
dynamodb copied to clipboard

Joi.date().timestamp('javascript') type and rangeKey

Open thibauds opened this issue 6 years ago • 0 comments

Hi,

I wanted to know what is the expected behavior of setting a schema attribute to the Joi.date().timestamp('javascript') validator. I mean should this field be a String or a Number.

I supposed it was a Number but when I used it for a rangeKey and tried to fetch the item with the following code:

var d = (new Date()).getTime()
Table.get('myKey`, d, (err, item) => {...});

I was getting a ValidationException: The provided key element does not match the schema and realized the rangeKey was sent as a String and not a Number.

So is this the expected behavior?

thibauds avatar Mar 13 '18 16:03 thibauds