Database

[{"_id":ObjectId("5ef44528af5a1a2a641cd52b"),"active":true,"name":"CompanyA","contacts":[{"secondary_emails":[],"_id":ObjectId("5f19727495f4da29403923e3"),"email":"contact@gmail.com","designation":"VP Cloud & Security","address":"","name":"Ron"}],"services":[{"active":true,"_id":ObjectId("5ef44528af5a1a2a641cd52d"),"name":"Company Management","title":"Company Helpline","description":"Offering voice, meetings, collaboration and contact center all on one cloud platform.","categories":["SD-WAN","Security and Compliance"],"sub_categories":["Solution"],},{"active":true,"_id":ObjectId("5ef44528af5a1a2a641cd52c"),"name":"Company HR","title":"Human Resources","description":"Offering HR Services to all","categories":["HR","Company"],"sub_categories":["Solution"],}]}]

Query

db.collection.find({"services":{$elemMatch:{categories:{$regex:"SD-WAN",$options:"i"}}}},{"services":{$elemMatch:{categories:{$regex:"SD-WAN",$options:"i"}}}})

Result