mongodb - Mongoose query where value is not null -


looking folling query:

entrant     .find       enterdate : onemonthago       confirmed : true     .where('pincode.length > 0')     .exec (err,entrants)-> 

am doing clause properly? want select documents pincode not null

you should able (as you're using query api):

entrant.where("pincode").ne(null) 

... result in mongo query resembling:

entrants.find({ pincode: { $ne: null } }) 

a few links might help:


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -