Mongoose query where value is not null

You should be able to do this like (as you’re using the query api):

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

… which will result in a mongo query resembling:

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

A few links that might help:

Leave a Comment