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

MongoDB.connect callbacks with error that is an EventEmitter

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.12
    • Affects Version/s: None
    • Component/s: None

      Calling `MongoDB.connect(url, mongoOptions, cb);` callbacks with an error that is an EventEmitter. My full code is:

      var MongoDB = require('mongodb');
      
      var url = 'mongodb://<user>:<password>@<my-db-url>';
      var mongoOptions = {
        db: { safe: true, native_parser: false },
        server: { autoReconnect: true, reconnectTries: Infinity },
        replSet: {}
      };
      
      var cb = function (e, r) { console.log('error:', e, 'res', r); };
      
      MongoDB.connect(
        url,
        mongoOptions,
        cb
      );
      

      Happy to provide more context. I'm on node v4.6.1, connecting to mongo 3.2.8

            Assignee:
            Unassigned Unassigned
            Reporter:
            sabranguillaume Guillaume Sabran
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: