I have a temp column and a minimum temp column. the temp column is just over written continuously, but when temp is less that minTemp, minTemp is updated to reflect the new low. I know the code below is wrong, so my columns are
id and date <- these are my keys
temp <- this is the current temperature
minTemp <- this is the lowest temperature for the day
And here is the non-working code, but to get an idea of what I am trying to do
var tparams = {
Key: { id: id, date: dayofyear(date)},
TableName: "myTable",
UpdateExpression: "Set minTemp = temp",
ConditionExpression: "temp < minTemp",
ExpressionAttributeValues:{
'temp' : 'minTemp
}
ReturnValues: "UPDATED_NEW"
};
console.log(tparams);
Why does it just seem the aws docs are of very little help?