-
Notifications
You must be signed in to change notification settings - Fork 35
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
Type mismatch for key id #17
Comments
BTW, the id is a uuid generated each time by node-uuid. |
Can you confirm what item you're saving? It seems to me right now that you may be saving the first time as '' and the second time as {S: ''}. The reason why you're getting the type mismatch is because the library treats object types as Map types. |
I know this is old, but in case anyone else comes here from a google search for a similar issue (like I did), I thought I'd share my solution. The error is saying that DynamoDB expected a string for the uuid, but it is getting something else. |
Dude, Thank you! |
You rock! Thank you. |
Thank you zachpetch! |
For those coming here to look for solutions: |
@artursvonda I literaly logged in just to thank you for this! |
What sad was I had the same issue in 2020....consistency AWS... so in short: |
Got the same issue. Fixed by removing data type declaration. before after: |
Saving the same item causes the following error the second time it is saved.
{"message":"One or more parameter values were invalid: Type mismatch for key id expected: S actual: M","code":"ValidationException","time":"2014-12-01T00:03:13.754Z","statusCode":400,"retryable":false,"retryDelay":0}}
{ TableName: 'companies',
Item:
{ name: 'Edenic Confluence, LLC',
data: { this: 1, that: 'abc' },
id: '7c67562e-bddc-4931-b867-c78ed2862f56' } }
If I restart node.js, it works again the first time.
The text was updated successfully, but these errors were encountered: