File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
connect/connection-options Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -61,16 +61,15 @@ String` tab to see the corresponding code.
6161 :start-after: start-client-opts
6262 :end-before: end-client-opts
6363 :dedent:
64- :emphasize-lines: 1
6564
6665 .. tab:: Connection String
6766 :tabid: connection-string
6867
69- .. literalinclude :: /includes/connect/csot. go
70- :language: go
71- :start-after: start-string
72- :end-before: end- string
73- :dedent:
68+ .. code-block :: go
69+ :copyable: true
70+
71+ uri := "<connection string>/?timeoutMS=200"
72+ client, err := mongo.Connect(options.Client().ApplyURI(uri))
7473
7574.. note:: Retries Under Timeout Specification
7675
Original file line number Diff line number Diff line change @@ -16,10 +16,7 @@ func main() {
1616 opts := options .Client ().SetTimeout (200 * time .Millisecond )
1717 client , err := mongo .Connect (opts )
1818 // end-client-opts
19- // start-string
20- uri := "<connection string>/?timeoutMS=200"
21- client , err := mongo .Connect (options .Client ().ApplyURI (uri ))
22- // end-string
19+
2320 if err != nil {
2421 log .Fatal (err )
2522 }
You can’t perform that action at this time.
0 commit comments