Created
November 24, 2016 09:24
-
-
Save iworkforthem/feb1c3844b21a98b5a11cd3407784098 to your computer and use it in GitHub Desktop.
mongoose query events at specific 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
var today = req.body.today; | |
var runDate = (today == '' || today == null ? new Date() : new Date(today)); | |
var tommorrow = new Date(runDate); | |
tommorrow.setDate(tommorrow.getDate() + 1); | |
console.log(); | |
console.log('start '+dateFormat(runDate, "yyyy-mm-dd")); | |
console.log('end '+dateFormat(tommorrow, "yyyy-mm-dd")); | |
Event.find({ | |
updateDate: { | |
$gte : runDate, | |
$lt : tommorrow | |
} | |
}, function(err, events) { | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment