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

Stop emitting topology events from `Db`

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0
    • Component/s: native
    • Labels:

      Description

      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));

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eric.adum Eric Adum (Inactive)
              Reporter:
              matt.broadstone Matt Broadstone
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: