MongoDB.connect callbacks with error that is an EventEmitter

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.2.12
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Guillaume Sabran
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: