How to query below scenario using aggregate query in mongodb
Lets say docs look like
{ _id:"1", subjId:"abc", Grades:[{ rank:1,