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

Stop emitting topology events from `Db`

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

      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@mongodb.com Eric Adum (Inactive)
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: