Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4423

LinqProvider.V3 Odata filter problem with id filter (string/ObjectId)

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 2.21.0
    • 2.18.0
    • LINQ3
    • None
    • Fully Compatible
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      Hi,

      after switching from V2 to V3 we get an exception by filtering with Odata:

      https://localhost:5001/odata/items?&$filter=id%20eq%20%27000000000000000000000001%27%20

      MongoDB.Driver.Linq.ExpressionNotSupportedException: 'Expression not supported: Convert($it.Id, String).'

      public class Item
      {
      [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
      public string Id

      { get; set; }

      }

       

      Thanks!

      Attachments

        Activity

          People

            oleksandr.poliakov@mongodb.com Oleksandr Poliakov
            dimitri.kroo@baramundi.com Dimitri Kroo
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: