How can I use below script for deleting 5K records:
db.transaction.deleteMany({
"timeStamp": { $gte: new Date(2018, 0, 1), $lt: new Date(2019, 0, 1) }
})
I tried with finding first in collection, but it's saying 0 records fetched.
db.transaction.find({
"timeStamp": { $gte: new Date(2018, 0, 1), $lt: new Date(2019, 0, 1) }
})
Output: Fetched 0 record(s) in 31ms
But i checked in collection below records with these timestamp are present,
"timeStamp" : ISODate("2018-12-31T18:30:03.379Z"),
"timeStamp" : ISODate("2018-12-31T18:30:03.982Z"),