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

BsonTypeMapper.TryMapToBsonValue fails when passed a QueryDocument

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

      To reproduce:

      var query = new QueryDocument("x", 1);
      BsonValue bsonValue;
      var ok = BsonTypeMapper.TryMapToBsonValue(query, out bsonValue);
      

      TryMapToBsonValue knows about the BsonDocument object model, but not about the classes derived from BsonDocument (like QueryDocument).

      There is a pull request from Oleg Kosmakov with a fix for this:

      https://github.com/mongodb/mongo-csharp-driver/pull/133

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: