MongoDB时间范围查找
1.查询时间范围,且模糊匹配message列中含“锋”字符串的记录
db.server.find(
{
"time":{"$gt":ISODate("2023-01-05T11:36:50+08:00"),"$lt":ISODate("2023-01-06T00:00:00+08:00")},
"message":/锋/
}
)
.projection({})
.sort({time:-1})