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

"Server Discovery and Monitoring engine" deprecation warning is confusing

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.3.2
    • Affects Version/s: 3.3.1
    • Component/s: Native

      The latest version shows the following warning:

      DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to MongoClient.connect.

      Reading this, one might assume that this options has to be passed to the connect method:

      new MongoClient(connectionUri).connect({ useUnifiedTopology: true })
      

      That doesn't work, however, because options can only be passed to the constructor:

      new MongoClient(connectionUri, { useUnifiedTopology: true }).connect()
      

      The deprecation warning should be changed to be less confusing.

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            niklas@shroudedcode.com Niklas Higi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: