Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2683

Deprecate the "mongo.NewClient" and "Client.Connect" APIs

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.12.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      We're deprecating mongo.NewClient and Client.Connect and recommending all users use mongo.Connect instead.

      As far as I've found, all of our Go docs use mongo.Connect. However, I've found some blog posts that still recommend mongo.NewClient:

      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?
      1.12+

      Show
      1. What would you like to communicate to the user about this feature? We're deprecating mongo.NewClient and Client.Connect and recommending all users use mongo.Connect instead. As far as I've found, all of our Go docs use mongo.Connect . However, I've found some blog posts that still recommend mongo.NewClient : https://www.mongodb.com/blog/post/quick-start-golang--mongodb--how-to-create-documents 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to? 1.12+

      There are no known use cases for the mongo.NewClient API that aren't followed by an immediate call to client.Connect. Since mongo.Connect already combines those two behaviors, there's no known use case for mongo.NewClient, so deprecate it for removal.

      Definition of done:

      • Deprecate mongo.NewClient and Client.Connect.
      • Document that a Client cannot be reconnected after calling Client.Disconnect.

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: