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

XMLWordPrintableJSON

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

      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
              Reporter:
              Itzhak Kagan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: