[CSHARP-837] LINQ Provider Needs to Support string.CompareTo for String Comparisons Created: 03/Oct/13  Updated: 20/Jan/16  Resolved: 22/Apr/15

Status: Closed
Project: C# Driver
Component/s: Linq
Affects Version/s: None
Fix Version/s: 2.1

Type: Improvement Priority: Major - P3
Reporter: Craig Wilson Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Rewrite Linq

 Description   

Need to support the string comparison operator for when users would like to, for example, find all people whose names are greater than John.

var results = collection.AsQueryable().Where(x => x.Name.CompareTo("John") > 0);



 Comments   
Comment by Craig Wilson [ 22/Apr/15 ]

This is now support as long as the comparand is the constant 0.

So, this doesn't work:

x => x.Name.CompareTo("John") == 1

Comment by Githook User [ 22/Apr/15 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-837: added support for CompareTo in the predicate translator.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/111ec0c7b0c76a691327f85f680adc6ee47c4236

Generated at Wed Feb 07 21:37:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.