'Records inserted into DynamoDb via typedORM have incorrect Entity info
When I insert records into my local dynamoDb table via typeDORM in a lambda, it inserts the record with the wrong entity information. For example the GSI1PK
GSI1: {
partitionKey: 'PRO#{{primary_key}}',
sortKey: 'PRO#{{primary_key}}#YEAR#{{year}}',
type: INDEX_TYPE.GSI,
},
of a Pro record should be (and is when run the code as an individual node file) PRO#PROCUREMENT_2022 but when I run the same code as a lambda it saves the GSI1PK as an IdList entity LIST#PROLIST_2022. I was able to find out that depending on which Entity I added last in my typedORM.createConnection function, that was the where the GSI1PK information would be built. Is there a reason that the createConnection function is giving different results when the code is run from a lambda vs as a standalone node file?
createConnection({
entities : [Procurement, IdList],
name : 'default',
table : testTable,
}) ;
This code works when it is run as a standalone node file and is able to handle the Procurement and IdList entities at the same time.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
