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.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: