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

IBsonSerializer for a mapped member should flow through expression tree when result type is the same.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      C# Sprint 14

      Description

      Given a class of type Person

      class Person
      {
        [BsonRepresentation(BsonType.ObjectId)]
        public string Id {get; set;}
      }

      The aggregation framework expression trees are currently losing the ObjectId representation.

      .Project(x => new { MyId = x.Id })
      .Match(x => x.MyId == "54b73ce5e9080a3534370443")

      The Match should render the "54b73..." as an objectId in the query, but instead it renders it as a string because we lost the serialization information when we did a projection.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            craiggwilson Craig Wilson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: