Database
[{_id:ObjectId("621c3a41fa2fe3c07f43edc9"),user:"620c81434d8a65c1aa36e0d4",notes:[{title:"Eraning",tags:["ern","lrn","dik","pik","sik"],note:"Prior to his return, Craig worked at NeXT, followed by Apple, and then spent a decade at Ariba, an internet e-commerce pioneer where he held several roles including chief technology officer.\nPrior to his return, Craig worked at NeXT, followed by Apple, and then spent a decade at Ariba, an internet e-commerce pioneer where he held several roles including chief technology officer.",_id:ObjectId("62205a32bab7aed6315195e9")},{title:"Lerningngs",tags:["lrn","eat","drink"],note:"Prior to his return, Craig worked at NeXT, followed by Apple, and then spent a decade at Ariba, an internet e-commerce pioneer where he held several roles including chief technology officer.\n",_id:ObjectId("6220583cbab7aed63151958b")},{title:"Learning",tags:["learn","eran","buy","sell"],note:"Prior to his return, Craig worked at NeXT, followed by Apple, and then spent a decade at Ariba, an internet e-commerce pioneer where he held several roles including chief technology officer.Solving DSA from Maths.in and SolveMaths.org using great techniques by INDIA and RUSSIA.",_id:ObjectId("6220532dbab7aed631519531")},{title:"Biology",tags:["tissue","cell","myto","energy","glycogen","hydrogen"],note:"Prior to his return, Craig worked at NeXT, followed by Apple, and then spent a decade at Ariba, an internet e-commerce pioneer where he held several roles including chief technology officer.Solving DSA from Maths.in and SolveMaths.org using great techniques by INDIA and RUSSIA.",_id:ObjectId("621f88d4c189c6b5501c3d5f")},{title:"Chemistry",tags:["this","is","great","thing","to","do","by","time"],note:"Prior to his return, Craig worked at NeXT, followed by Apple, and then spent a decade at Ariba, an internet e-commerce pioneer where he held several roles including chief technology officer.",_id:ObjectId("621f85e9c189c6b5501c3d49")},{title:"Physics",tags:["newtonlawsofmotion","ktg","thermo","fluid","mechanice","bernaulii"],note:"P + hrg + 1/2rv^2 = constant",_id:ObjectId("621f8520c189c6b5501c3d3f")},{title:"Maths",tags:["trignometry","llp","continuity","tags","circle"],note:"Solving DSA from Maths.in and SolveMaths.org using great techniques by INDIA and RUSSIA.",_id:ObjectId("621f84d7c189c6b5501c3d37")},{title:"DSA from Net",tags:["dp","stack","queue","heaps","sorting"],note:"Solving DSA from Leetcode.in and GeeksforGeeks.org",_id:ObjectId("621c3a41fa2fe3c07f43edca")}],__v:7}]
Query
db.collection.find({user:"620c81434d8a65c1aa36e0d4"},{notes:{$filter:{input:"$notes",as:"note",cond:{$in:["ern","$$note.tags"]}}}})