But there are several bad things about that. First of I haven’t typed anything, so now when I store null data it stores stuff like {NULL: true} in the db (wth?)
It displays true but that’s not the real stored value… Anyway.
I quickly looked around and found http://awspilot.github.io/dynamodb-oop/ which seems decent and much simpler to reason with. But any experienced feedback is welcome.
Edit: The way it displays in the AWS Console isn’t related to the ORM in any way, it’s just how AWS displays its data. And they display it rather bad, when {NULL: true} just shows true on the console, it’s misleading.
For JavaScript I’ve been using the AWS.DynamoDB.DocumentClient library. DynamoDB has a number of interesting quirks (like not being able to store an empty string). For null it stores {NULL: true} so it sounds like it’s working the way I would expect.
I started by using DocumentClient too, but then I had to do a PATCH endpoint with dynamic attributes, and the fancy way with the UpdateExpression was too restrictive to my taste. Not only I don’t like the format, but it didn’t look friendly with dynamic attributes:
params = {
TableName: tableName,
Key: {
feedbackId,
},
// 'UpdateExpression' defines the attributes to be updated
// 'ExpressionAttributeValues' defines the value in the update expression
UpdateExpression: "SET rating = :rating, description = :description, updatedAt = :updatedAt",
ExpressionAttributeValues: {
":rating": data.rating,
":description": data.description,
":updatedAt": moment().toISOString(),
},
ReturnValues: "ALL_NEW"
};
This PATCH endpoint would fail when either rating or description wasn’t provided.
I feel your pain. My team just decided to write one since we couldn’t really fine one that works smoothly, and using this on production everyday. and I proudly recommend you to give it a try
“interesting quirks” is a bit of an understatement… my work with it lately has been in Python, but a colleague here is using https://github.com/ryanfitz/vogels in her JS code… Looked pretty good.