Skip to content

Instantly share code, notes, and snippets.

@kolexinfos
Created September 28, 2016 09:54
Show Gist options
  • Select an option

  • Save kolexinfos/77bbc895a697cc9bdcbc1604f6f343ee to your computer and use it in GitHub Desktop.

Select an option

Save kolexinfos/77bbc895a697cc9bdcbc1604f6f343ee to your computer and use it in GitHub Desktop.
var Verify = require('../models/verify');
var now = new Date();
now.setDate = (now.getHours() - 1)
Verify.find( //query today up to tonight
{"created_on": {"$gte": now }})
Throws an error of type mismatch, I also tested and see the that the $lt and $gte takes on Date types.
@kolexinfos
Copy link
Copy Markdown
Author

Can you use it in the Mongoose Context like in my initial post, I know all this works but I need to check a dateTime field in a mongo collection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment