Here is what i am trying to achive, i have a doc which stores a list of images in the image Array and i get those shortly after the record is created. After i upsert the Images Array with Image info, i also create a entry in the History Array which stores when the update happened and if it was an Initial load or update
History: [
{
"DateTime": "2022-03-20 11:14:17",
"Action": "ImageInitialLoad",
"Status": ""
},
{
"DateTime": "2022-03-21 20:10:20",
"Action": "ImageRefreshLoad",
"Status": ""
}]
So what i need is a way to get the newest / latest entry in the History array where Action is either
ImageInitialLoad or ImageRefreshLoad and compare it to the Record.Photos.PhotosChangeTimestamp
and its true if the Record.Photos.PhotosChangeTimestamp is > then the latest date with the above creteria in History Array
How can i achieve that