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

Document Set does not always replace the correct field.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.3
    • Affects Version/s: 0.0.2
    • Component/s: None
    • None

      It's possible to use the Document.Set function and get a resulting document with the wrong field replaced. After discussion with kris.brandow it seems like the problem is this line:

      https://github.com/mongodb/mongo-go-driver/blob/master/bson/document.go#L259

      which should be replaced with d.elems[d.index[i]] = elem

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            thomas.delacour@mongodb.com Thomas Delacour (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: