collection functions change the options object

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.1.8
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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:
              Christian Amor Kvalheim
              Reporter:
              Zoltán Mihályi
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: