Document Set does not always replace the correct field.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.0.3
    • Affects Version/s: 0.0.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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:
            Kristofer Brandow (Inactive)
            Reporter:
            Thomas Delacour
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: