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

UpdateBuilder.SetOnInsert interface is incomplete

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.8.3
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The current UpdateBuilder API only allows the value of the named element to be set.

      See the following code UpdateBuilder.cs#L680:

       public static UpdateBuilder SetOnInsert(string name, BsonValue value)
      

      And UpdateBuilder.cs#L1658:

              public UpdateBuilder SetOnInsert(string name, BsonValue value)
      

      For completeness, we should consider adding an overloaded method to provide a complete document. For example:

       public static UpdateBuilder SetOnInsert(BsonDocument document) { ... }
       public UpdateBuilder SetOnInsert(BsonDocument document) { ... }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            jim.oleary@mongodb.com James O'Leary
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: