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

BsonDocument which is null actually create an object with one name-value pair

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.1
    • Component/s: Serialization
    • Environment:
      windows 7 64 bit WiredTiger engine

      If I create a property in a class like:

      public class User
      {
          public string Id { get; set; }
          public BsonDocument UserSettings { get; set; }  
          .....
      }
      

      If the UserSettings is null when a new document is inserted then the driver actually creates a bson document with one name-value pair like that:

      "userSettings" : {
          "_csharpnull" : true
      },
      

      That looks strange to me since i expected that property to be null like that:

      "userSettings" : null,
      

      Am I missing something?

      Thanks,
      Itzik

            Assignee:
            Unassigned Unassigned
            Reporter:
            itzikkg Itzhak Kagan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: