sreepathy s prabhu

sreepathy s prabhu

  • 2k
  • 217
  • 96.6k

How to check an item already exist in mongo db and linq

Oct 15 2015 12:59 AM
 var database = Connection.testDB;         bool isExists = false; var Collection = database.GetCollection<technolgy>("technology"); var query1 = Collection.FindAll().SetFields(Fields<technolgy>.Include(  x => x.Name)); var CompanyCount = (from c in query1 select c).ToList(); foreach (var item in CompanyCount) {             isUserExists = (from t in CompanyCount where t.Name.Equals(Name) select t).SingleOrDefault() == null ? false : true; if (isExists == true) { return isExists; } } return isExists;

My problem is case sensitive search. For ex. in my database there is field called technology in that ,say Audio And Video is saved.If my query term is Audio And Video my query will return true(isExists).But if i my query term is audio and Video it returns false.How to make my query case insensitive

Answers (1)