Finding Nested query with Mongodb

Hi MongoDB

I am now to this mongdb and I was wondering how so I search a nested query

db.vulnerabilities.find({“exploitability”: “3”}).pretty() works however how does one search nested information in my data set below.

For example if I wanted to look for technical: 3 in the string below.

db.vulnerabilities.insert ({a_number: ‘A1’,type: ‘Injection’,threatAgents: ‘application specific’,exploitability: ‘3’,“security weakness”: {prevalence: ‘2’,detectability: ‘3’,}, “impacts”: {technical: ‘3’,business: ‘business specific’,} })

Hello, @tim_Blath!

You can query embedded documents using dot-notation.

Consider taking some basic course on MongoDB to learn how such things are done.

1 Like