Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-662

collection functions change the options object

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1.8
    • Affects Version/s: None
    • Component/s: None

      Passing an options object to a collection method (i tested with aggregate) extends the original object with additional properties, instead of creating a new one. The problem is with the implementation of the getReadPreference function.

      var opts = {};
      db.collection('items').aggregate([], opts);
      console.log(opts);

      The following code prints a big circular object instead of a simple {}.

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            zoltan.mihalyi Zoltán Mihályi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: