IgnoreIfDefault not working?

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.10.2
    • Component/s: BSON
    • None
    • Environment:
      Windows 10
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Setting IgnoreIfDefault to true through the BsonClassMap.RegisterClassMap call does not seem to work.

      Eg:

      doc.MapMember(x => x.TriesDone).SetIgnoreIfDefault(true);
      

      TriesDone gets serialized to the database with a default value of 0. I am having the same issue with reference types set to null.

              Assignee:
              Robert Stam
              Reporter:
              Brecht Vanhaesebrouck
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: