//选择数据库
use test
// 按日期查询记录 查询2021-05-24之前的数据
//db.fs.files.find({"uploadDate":{$lt: new Date(2021,04,24)}})
//删除数据 日期小于 2021-05-01 的数据
db.fs.files.remove({"uploadDate":{$lt: new Date(2021,04,01)}})
使用new Date() 需注意 月份是以0开始的
//选择数据库
use test
// 查询记录
db.fs.files.find({"uploadDate":{$lt: ISODate("2021-04-24T16:00:00Z")}})
//删除数据 日期小于 2021-04-01 的数据
//db.fs.files.remove({"uploadDate":{$lt: ISODate("2021-04-21T16:00:00Z")}})