mongodb not null code example Example: mongodb exists and not null Click to copydb.collection1.find({ 'fieldname1' : { $exists: true, $ne: null } });