Without remodelling your data, as @steevej demonstrates in the linked post, I think this is going to be difficult.
Another approach might be to add a flag to the last item of the array, something like open: true
and then use arrayFilters to match on that field. Then, when you add a new item to testHistory
(starting a new results
array), you unset the existing open
flag and attach it to the new last item in the array. But I think that’s equally fiddly.