-
Notifications
You must be signed in to change notification settings - Fork 27
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
get item by partition key returns error only inside lambda #412
Comments
orr-levinger
changed the title
git i item by partition key returns error
git get item by partition key returns error
Nov 8, 2023
orr-levinger
changed the title
git get item by partition key returns error
get item by partition key returns error
Nov 8, 2023
orr-levinger
changed the title
get item by partition key returns error
get item by partition key returns error only inside lambda
Nov 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
This bug happens to me only when running in a lambda. When running locally this doesnt happen.
here are my libs versions:
dynamo-easy version: 8.0.0-next.3
aws v3 dynamo version: 3.445.0
Node.js Version: v18.18.0
I have a model that has a string field called status:
here is the DDB table definition:
here is my table item instance:
this is the query i run:
only when this code runs inside lambda i get the error:
{
"errorType": "Error",
"errorMessage": "could not resolve the dynamo db type for attribute value invited",
"stack": [
"Error: could not resolve the dynamo db type for attribute value invited",
" at typeOfFromDb (/opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/mapper/util.ts:231:9)",
" at fromDbOne (/opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/mapper/mapper.ts:291:64)",
" at /opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/mapper/mapper.ts:274:20",
" at Array.forEach ()",
" at fromDb (/opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/mapper/mapper.ts:244:44)",
" at Object.fromDb (/var/task/src/functions/events/webpack:/blind-chat-backend/src/models/match-model.ts:75:14)",
" at /opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/mapper/mapper.ts:268:50",
" at Array.forEach ()",
" at fromDb (/opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/mapper/mapper.ts:244:44)",
" at /opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/dynamo/request/read-many.request.ts:222:63",
" at Array.map ()",
" at ReadManyRequest.mapFromDb (/opt/nodejs/node_modules/@shiftcoders/dynamo-easy/src/dynamo/request/read-many.request.ts:222:43)",
" at processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at Runtime.v [as handler] (/var/task/src/functions/events/webpack:/blind-chat-backend/src/functions/events/get-match.ts:16:3)"
]
}
when creating a property mapper:
that does nothing special just what dynamo-easy was supposed to do it works..
and prints:
fromDb orr { S: 'invited' }
also noticed the wrong mapper is chosen:
INFO dynamo.mapper.mapper (Object): map toDb {"item":"Conscientiousness"}
The text was updated successfully, but these errors were encountered: