Created
April 1, 2016 13:19
-
-
Save roboflank/185f596f4154aea4f2884967bca4ad4e to your computer and use it in GitHub Desktop.
Query Data From Mongoose and Filter Depending on Date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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