Skip to content

Instantly share code, notes, and snippets.

@yankeyhotel
Created August 12, 2015 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yankeyhotel/19a3aea726184bda69c2 to your computer and use it in GitHub Desktop.
Save yankeyhotel/19a3aea726184bda69c2 to your computer and use it in GitHub Desktop.
Find a value of greater than or null in Mongo Collection
var coupon = Coupons.findOne({
codes: { $in: [coupon_code] },
valid: true,
redeem_by: { $lte: now },
$or: [
{ end_date: { $gte: now } },
{ end_date: null }
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment