What's the proper way of retrieving the entries that were created in the last 5 minutes if I'm currently using Model.find()?
Calculate the time of five minutes ago and then use the $gte operator:
var d = new Date();
d.setMinutes(d.getMinutes()-5);
Model.find({created_at: {$gte: d}}, callback);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With