Missing shallow copy in DB.collection

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.1.1
    • Affects Version/s: 3.1.0
    • Component/s: Native
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      3.1 got released a couple of hours ago and took down my server. The issue looks to be a bug in 3.1 that is triggered by a bug in my code.

      For some reason my code was doing:

      const collection = this.db.collection(name, name);

      i.e. passing a string to the options arg. This worked in 3.0 but breaks in 3.1. The reason is that in 3.1 the shallow copy is broken.

      3.0: https://github.com/mongodb/node-mongodb-native/blob/3.0/lib/db.js#L412
      3.1: https://github.com/mongodb/node-mongodb-native/blob/master/lib/db.js#L316
       
      Not the object.assign isn't assigned to options? I presume it should read
      options = Object.assign({}, options);

            Assignee:
            Matt Broadstone
            Reporter:
            Gavin Matthews
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: