Database

[{_id:1,f1:"senior",f2:"manager"},{_id:2,f1:"junior",f2:"manager",},{_id:3,f1:"fresher",f2:"developer"},{_id:4,f1:"manager",f2:"senior"}]

Query

db.collection.aggregate([{$addFields:{matchResult:{$and:[{$or:[{$regexMatch:{input:"$f1",regex:"senior",options:"x"}},{$regexMatch:{input:"$f2",regex:"senior",options:"x"}}]},{$or:[{$regexMatch:{input:"$f1",regex:"manager",options:"x"}},{$regexMatch:{input:"$f2",regex:"manager",options:"x"}}]}]}}},{$match:{matchResult:true}}])

Result