Follow the following syntax:
db.collection1.find({ 'fieldname1' : { $exists: true, $ne: null } });
When $exists is true, $exists matches the documents that contain the particular field, including documents where the field value is null. If the value is false, the query returns only the documents that do not consist of the field. $ne picks the documents where the value of the field is not equal to the particularized value. This incorporates documents that do not contain the field.