OR and Exists together in MongoDB Query

OR and Exists can be used together in MongoDB together along with find Query. OR can be used to check any of the condition is matched Exists is used to check whether particular node exists or not.

MongoDB Query :

     $or : [ { "employee.number" : null },
             {"employee.number":{$exists: false}},
             { "employee.name" : null },
             {"employee.name":{$exists: false}}

Above Query retrieves the data from employeeDetails collection which dosent have employee.number or employee.name and it should be active and should contain employee.pf value.