Skip to content

Commit

Permalink
update readme to reflect latest breaking changes to init client conne…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
Bob Hall authored and Bob Hall committed Feb 20, 2019
1 parent 664a2e4 commit 5842349
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To get started with the driver, import the `mongo` package, create a `mongo.Clie
```go
import "github.com/mongodb/mongo-go-driver/mongo"

client, err := mongo.NewClient("mongodb://localhost:27017")
client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
```

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

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

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

0 comments on commit 5842349

Please sign in to comment.