How can i update some field except obj field?

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      type Update struct

      { Name string `bson:"name"` Obj *StructB `bson:"obj,omitempty"` }


      type StructB struct

      { A string `bson:"a"` }

      update := Update

      { Name:"name", }


      db.Update(filter,update)

      error message ``"multiple write errors: [{write errors: [{'$set' is empty. You must specify a field like so: {$set:

      {<field>: ...}

      }}]},

      {<nil>}

      ]"``

            Assignee:
            Unassigned
            Reporter:
            bakatest
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: