Struggling with creating a condition to check if 30 days have passed since specified ISODate
in mongo.
The field name is creationDate
, Im using find
function, and I want to find only these, where 30 days have passed from creation date.
User.find({
creationDate: {
$gte: ...
}
});
In Javascript I would simply do something like
(+new Date() - +new Date(creationDate))/60/60/24 >= 30
In a brief, I want to find only these elements, where 30
days have passed from creating it in mongo db. Looking for any kind of help!