Filter the Collection in DB instead of Memory
I\'m having a Model Class, Save it in a MongoDB Collection then Query the same as per my expec
EDIT
Added projection - so selected array contains only documents where IsLive==true
I think it is easier to use typed queries as c# is strongly typed language.
I used ElemMatch as this is designed to scan an array and looks for a matching element.
var filterDef = new FilterDefinitionBuilder();
var filter = filterDef.Eq(x => x.IsLive, true);
var projectDef = new ProjectionDefinitionBuilder();
var projection = projectDef.ElemMatch("EmpMobile", "{IsLive:true}");
var empList = collectionEmpInfo.Find(filter).Project(projection).ToList();