我想写一个查询来检索mongodb中的日期。
{
"created_at": "2018-05-29T14:04:54.000Z",
"origin": "mongo",
"id": "111111111",
"data": {
"_id": "11111111111",
"id": 111111111111,
"dcre": "2018-05-29T14:04:54.324Z",
}
我希望dcre": "2018-05-29"
或dcre": "2018/05/29"
代替dcre": "2018-05-29T14:04:54.324Z"
我试试
async find(date) {
const res = await this.db.collection('table').find({
dcre:date
}).limit(500).toArray();
return res;
}
但它不起作用