Did you find the link below? I haven't use DynamoDB but it appears you can most things that you can do with sql databases. If you want just the samples after a given time you can use that as a query condition, or if you want just the last 100 records then tell it to sort in reverse order and then use limit to fetch only the first 100 (which are actually the last 100). They will be in reverse order but you can re-order after you get them, or perhaps you can get the database driver to sort them again after fetching them. https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html
It would be absolutely beyond me to try and write a node from scratch to access DynamoDB. It appears there are plenty of nodes out there that do it, there's just very little in the way of documentation on how to utilise them.
OK So I've made some progress after hours of reading. I am able to use the AWS DynamoDB node with scan paramater from node-red-contrib-aws.
I now return content from my DynamoDB with each entry stored into an array. I have written a function to try an extract individual entries from the array and store them into another array to plot on a UI chart.
My code is as follows (to extract time and temperature). But I see nothing in the debug node after the function. Am I doing something wrong?