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

System.Decimal support in FilterDefinitionBuilder

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5
    • Component/s: Operations
    • Labels:
      None
    • Environment:
      Issue related to driver only

      When a filter is created with the FilterDefinitionBuilder for a decimal value then the resulting BsonDocument for the filter is constructed in the wrong way:

       var mongoClient = new MongoClient();
       var db = mongoClient.GetDatabase("db1");
       var collection = db.GetCollection<BsonDocument>("c1");
       decimal val = 99999421999.002M;
       var b =  new FilterDefinitionBuilder<BsonDocument>();
       var filter = b.Eq("f1", val);
       var bsonDocFiler = filter.Render(collection.DocumentSerializer, collection.Settings.SerializerRegistry);
       Console.WriteLine(bsonDocFiler["f1"].BsonType);
      

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

              Created:
              Updated:
              Resolved: