查询2个时间之间的值
let starttime =req.body.starttime;
<!--起始时间-->
let endtime = req.body.endtime;
<!--终止时间-->
let condata = {date:{ $gte: new Date(starttime), $lte: new Date(endtime) }}
模糊查询
文本搜索
let text = req.body.title;<!--输入的值-->
let searchdata = { title: { $regex: text, $options: 'i' } };