[GODRIVER-2683] Deprecate the "mongo.NewClient" and "Client.Connect" APIs Created: 10/Dec/22  Updated: 28/Oct/23  Resolved: 28/Apr/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.12.0

Type: Improvement Priority: Unknown
Reporter: Matt Dale Assignee: Matt Dale
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-2617 Remove or un-export all currently dep... Closed
Documented
Related
is related to GODRIVER-979 Remove context.Context parameter to m... Closed
is related to GODRIVER-2606 Deprecate unused functionality in pre... Closed
Epic Link: Go Driver 2.0 Prep
Quarter: FY24Q1
Documentation Changes: Needed
Documentation Changes Summary:

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+


 Description   

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.


 Comments   
Comment by Githook User [ 28/Apr/23 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2683 Deprecate NewClient and Client.Connect (#1234)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/592d916dff11fc8959b7eb9a73817780cb01b083

Comment by Matt Dale [ 18/Apr/23 ]

PR: https://github.com/mongodb/mongo-go-driver/pull/1234

Generated at Thu Feb 08 08:39:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.