I have an array inside my schema that creates timestamps for each array index created. I am trying to sort my documents so that the most active timestamp inside each function gets displayed first when returned from the find function. But the issue I am having is that I am using Mongoose Pagination and it only returns 10 documents at a time.
Let’s say I have documents of the user’s login information and inside each document, I have an array that stores every timestamp when they login. When calling the find function, I want to pass a query that goes through each selected document and retrieve the most updated timestamp from that specific array.