Skip to content

Commit 1098521

Browse files
author
Divjot Arora
committed
Add client.Connect to GoDoc
GODRIVER-436 Change-Id: I024c6b5c2787de7241006048f4ad528e87c4f6a4
1 parent a39a5f9 commit 1098521

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mongo/doc.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Package mongo provides a MongoDB Driver API for Go.
22
//
33
// Basic usage of the driver starts with creating a Client from a connection
4-
// string. To do so, call the NewClient function:
4+
// string. To do so, call the NewClient and Connect functions:
55
//
66
// client, err := mongo.NewClient("mongodb://foo:bar@localhost:27017")
77
// if err != nil { log.Fatal(err) }
8+
// err = client.Connect(context.TODO())
9+
// if err != nil { log.Fatal(err) }
810
//
911
// This will create a new client and start monitoring the MongoDB server on localhost.
1012
// The Database and Collection types can be used to access the database:

0 commit comments

Comments
 (0)