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

The BsonDocument doesn't equal to itself when has double.NaN value in it.

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.8.0
    • Component/s: BSON
    • None
    • Environment:
      C# MongoDB Driver 2.8.0
      .Net Framework 4.6.1
    • 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?

      This piece of code print False:

      var bd = new BsonDouble(double.NaN);
      var be = new BsonElement("test", bd);
      var document = new BsonDocument(be);

      Console.WriteLine(document.Equals(document));

       

      //This cause the BsonDocument can't be removed from a list.

      var list = new List<BsonDocument>();

      list.Add(document);
      list.Remove(document);  //Nothing happened here.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            tom3000 Tom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: