var start = new Date(new Date().setFullYear(new Date().getFullYear() - 1)); //Minus One Year
start.setHours(0,0,0,0); //Set to Start of the Day
var end = new Date();
end.setHours(23,59,59,999); //Set to End of the Day
print(start, end)
db.collection.aggregate()
.match({country: "Australia", created_date: {$gte: start, $lt: end}});
1 Like