Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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