'How to delete a map from list in an Item of a table in DynamoDB using nodeJS?
I am developing an app and I am using AWS DynamoDB as the database server. DB is connected with nodeJS. I have a table called chat to store messages. In chat table every item have connectionid as partition key. An item looks like this
{"id": "123456", "messages": [{"id": "1214545","message":"ksadfksfmsfsdf","sender":"112415", "timestamp": "27:1:2022:11:53"}]}
This is a single Item and there are more inside the chat table.
I have been trying to delete a message inside the item. Its easy for me to delete a whole item because connectionid is the partition key. But I want to delete it with respect to id which is nested. How to achieve this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|