Stop emitting topology events from `Db`

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.0
    • Affects Version/s: None
    • Component/s: Native
    • None
    • None
    • None
    • None
    • None
    • None

      The Db type is meant simply to be a layer for holding the database name, and some convenience methods you would run against a database. Instead, the Db object has too much context, and maintains legacy behavior like forwarding topology events. This is because it used to be the object returned from connect. The way it's currently written, it is impossible to provide the following user experience without breaking compatibility:

      const client = new MongoClient('mongodb://localhost/test');
      const coll = client.db('test').collection('test');
      coll.find().toArray(docs => console.dir(docs));

            Assignee:
            Eric Adum (Inactive)
            Reporter:
            Matt Broadstone
            None
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: