Skip to content

Commit 33a07ee

Browse files
committed
Merge branch 'pr/141'
Change-Id: I46ddb9fd7487966cb6d65889c12da9a6af3d0349
2 parents 9ff076f + 5842349 commit 33a07ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To get started with the driver, import the `mongo` package, create a `mongo.Clie
4242
```go
4343
import "github.com/mongodb/mongo-go-driver/mongo"
4444

45-
client, err := mongo.NewClient("mongodb://localhost:27017")
45+
client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
4646
```
4747

4848
And connect it to your running MongoDB server:
@@ -56,7 +56,7 @@ To do this in a single step, you can use the `Connect` function:
5656

5757
```go
5858
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
59-
client, err := mongo.Connect(ctx, "mongodb://localhost:27017")
59+
client, err := mongo.Connect(ctx, options.Client().ApplyURI("mongodb://localhost:27017"))
6060
```
6161

6262
Calling `Connect` does not block for server discovery. If you wish to know if a MongoDB server has been found and connected to,

0 commit comments

Comments
 (0)