Skip to content

Instantly share code, notes, and snippets.

@roboflank
Created April 1, 2016 13:19
Show Gist options
  • Save roboflank/185f596f4154aea4f2884967bca4ad4e to your computer and use it in GitHub Desktop.
Save roboflank/185f596f4154aea4f2884967bca4ad4e to your computer and use it in GitHub Desktop.
Query Data From Mongoose and Filter Depending on Date
myModel.find({
"date": {
'$gte': new Date('4/1/2016'),
'$lt': new Date('4/30/2016')
}
// will show data for the month of April
},
function(err, obj) {
if (err) return console.error(err);
console.log(obj);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment