Created
August 12, 2015 21:21
-
-
Save yankeyhotel/19a3aea726184bda69c2 to your computer and use it in GitHub Desktop.
Find a value of greater than or null in Mongo Collection
This file contains hidden or 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 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