Mongodb – How to get most recent Date from array of objects?
I had array of objects in each object had startDate , endDate, ownnerID, ownerType. I am getting the documents by uisng this below statement var yesterdayDate = new Date(); yesterdayDate.setDate(yesterdayDate.getDate() - 1); var next30daysDate = new Date(); next30daysDate.setDate(next30daysDate.getDate() + 29);…