Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1089

How can i update some field except obj field?

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      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>}

      ]"``

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: