I am using MongoDB which has a time field in milliseconds. I am trying to get all the records for previous day. So far I have searched for solutions which show how to get the records for previous 24 hrs. But I need records for previous day only. Please help to write this query. So something like this
createdTime: {
$lt: new Date().getTime(),
$gt: new Date().getTime() - 1000 * 60 * 60 * 24,
},
But like I explained this is not what I want.