I have a map in dynamo with the following structure:
participants: {
M: {
"6ecd8c99-4036-403d-bf84-cf8400f67836": {
M: {
participantUid: {
S: "6ecd8c99-4036-403d-bf84-cf8400f67836",
},
userSummary: {
M: {
userRef: {
S: "refGoesHere",
},
},
},
isRead: {
BOOL: false,
},
},
},
},
},
I'm trying to update the isRead property with the following command:
const updateReadStatusCommand = new UpdateCommand({
TableName: config.database,
Key: {
PK: `TASK#${taskUid}#CLIENT#${client}`,
SK: `THREAD#${uid}`,
},
UpdateExpression: `SET participants.#participantUid.isRead = :isRead`,
ExpressionAttributeNames: {
"#participantUid": userUid,
},
ExpressionAttributeValues: {
":isRead": updateBody.isRead,
},
ReturnValues: "ALL_NEW",
});
So far I keep running into the following error: The document path provided in the update expression is invalid for update.
I'm struggling to see the issue here, as it won't recognise the property within the map. Can anyone point me in the right direction?
Edit:
I've also scanned the table to ensure that the data is in the correct format and it looks like this:
"participants": {
"6ecd8c99-4036-403d-bf84-cf8400f67836": {
"isRead": false,
"participantUid": "6ecd8c99-4036-403d-bf84-cf8400f67836",
"userSummary": {
"userRef": "refGoesHere"
}
}
},