"Server Discovery and Monitoring engine" deprecation warning is confusing

XMLWordPrintableJSON

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

      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
            Reporter:
            Niklas Higi
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: