LINQ Provider - LessThan operator and strings

127 views
Skip to first unread message

James Newton-King

unread,
Oct 3, 2013, 12:33:40 AM10/3/13
to mongodb...@googlegroups.com
I'm generating dynamic expression trees to query MongoDB and I cannot find a way to compare strings using the less than and greater than operators.

I found this discussion on Stackoverflow and it appears String.CompareTo is used in other LINQ providers but doesn't work with MongoDB:

Expression<<Func<string, bool>> filter = str => str.CompareTo("abc") > 0;

craiggwilson

unread,
Oct 3, 2013, 9:47:29 AM10/3/13
to mongodb...@googlegroups.com
Hi James,
  Yep, we apparently haven't added support for this.  I'm completely surprised you're the first person to bring this up.  I've filed a JIRA here: https://jira.mongodb.org/browse/CSHARP-837.

Thanks.
Reply all
Reply to author
Forward
0 new messages