node.js - mongoose select with !boolean or boolean and past date -
Just wondering how I will do the following selection:
Schema:
Items: {... premium: {isPremium: boolean, expiry date: date}} All items should be returned, where premium.isPremium == incorrect (or premium. IsPremium == true and premium.expididate & lt; = currentDate).
items.statistics = {getPremium: function (current date) {return.find () ('[Premium.isPremium': wrong}, 'premium.is premium'}: True, 'premium .expirid': {$ lte: currentDate}}]) .exec ()}} < / pre>
Comments
Post a Comment