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
Post a Comment