Skip to content

Instantly share code, notes, and snippets.

@franklinjavier
Last active March 21, 2016 02:11
Show Gist options
  • Save franklinjavier/581239399ccb9e45c596 to your computer and use it in GitHub Desktop.
Save franklinjavier/581239399ccb9e45c596 to your computer and use it in GitHub Desktop.
Get birthdays of the month
User
.find({
birthdate: { $exists: true },
$where: 'return this.birthdate.getMonth()+1 === 1' // january
})
.exec(function(err, users) {
console.log(err, users);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment