Yes, I haven't included the attribute properties when Puting an object. On the Item property we would need to specify the attributes for the different types.
Put
Item
In the case of a Post:
Item: { PK: { S: `TOPIC#<TOPIC>` }, SK: { S: `POST#<KSUID>` }, GSI1PK: { S: `POST#<KSUID>` }, GSI1SK: { S: `POST#<KSUID>` }, type: "POST", nrLikes: 0 }
And for the Like:
Item: { PK: { S: `USER#<USERNAME>` }, SK: { S: `LIKEPOST#<USERNAME>` }, GSI1PK: { S: `POST#<KSUID>` }, GSI1SK: { S: `LIKEPOST#<USERNAME>` }, type: "LIKE" }
In case you already have items on your table you need a migration. Depending on your use case:
brilliant, thanks :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, I haven't included the attribute properties when
Put
ing an object.On the
Item
property we would need to specify the attributes for the different types.In the case of a Post:
And for the Like:
In case you already have items on your table you need a migration.
Depending on your use case:
brilliant, thanks :)