📅  最后修改于: 2022-03-11 15:01:40.295000             🧑  作者: Mango
ar moment = require ('moment')
function previous_year_artist(req, res, next) {
var dateTimeTofilter = moment().subtract(1, 'year');
var filter = {
"date_added": {
$gte: new Date(dateTimeTofilter._d)
}
};
db.collection.find(
filter
).toArray(function(err, result) {
if (err) return next(err);
res.send(result);
});
}