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

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -