1

I tried to do string comparison using MongoDB C# driver, However, I always got error message as following:

Unable to determine the serialization information for the expression:

y.strVal.CompareTo("15.5")
var q2 = from objb in q1.AsQueryable<M>()
         where objb.lista.Any(y=> y.strVal.CompareTo(tempC.ToString())>=0)
         select objb;
Community
  • 1
  • 1
flyfish
  • 31
  • 6
  • 3
    I'm not sure about this, but I think it's being turned into a query and mongodb doesn't contain an `CompareTo` method. Have you tried `Equals` or even `==`? –  Jan 12 '17 at 08:24
  • 2
    Could you post how your model classes look like – Maksim Simkin Jan 13 '17 at 09:44

0 Answers0