MatchaIO / ServerlessTimesheet

Timsheets on the Serverless stack
1 stars 1 forks source link

Not using maps correctly to save records #44

Open RhysC opened 7 years ago

RhysC commented 7 years ago

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#putItem-property

I'm not mapping correctly, but it looks like DDB is handling it ok (somehow). This should be done explicitly as it will go to lemons when we read as we will get a DDB map, not a persistent record like we expect

RhysC commented 7 years ago

Ah, I'm.using doc client not db directly, however it seems to be a decorator pattern so other lower level methods can be used. I should be retrieving records using (batchget)[http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#batchGet-property]

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html