Skip to content

Commit 298b2ce

Browse files
committed
coe improvements
1 parent 4fd9bd6 commit 298b2ce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/includes/connect/connection-targets.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# Replace the placeholders with your credentials
55
uri = "<connection string>"
66

7-
# Set the server_api field of the options object to Stable API version 1
7+
# Sets the server_api field of the options object to Stable API version 1
88
options = { server_api: { version: "1" } }
9-
# Create a new client and connect to the server
9+
# Creates a new client and connect to the server
1010
client = Mongo::Client.new(uri, options)
11-
# Send a ping to confirm a successful connection
11+
# Sends a ping to confirm a successful connection
1212
begin
1313
admin_client = client.use('admin')
1414
result = admin_client.database.command(ping: 1).documents.first
@@ -25,7 +25,7 @@
2525
# end-local-connection
2626

2727
# start-local-connection-uri
28-
Mongo::Client.new("mongodb://host1/mydb")
28+
Mongo::Client.new("mongodb://host1:27017/mydb")
2929
# end-local-connection-uri
3030

3131
# start-localhost
@@ -44,6 +44,6 @@
4444
Mongo::Client.new([ 'host1:27017', 'host2:27018', 'host3:27019' ],
4545
database: 'mydb', replica_set: 'myapp')
4646

47-
# Or using the URI syntax:
47+
# Or by using a connection string:
4848
Mongo::Client.new("mongodb://host1:27017,host2:27018,host3:27019/mydb?replicaSet=myapp")
4949
# end-replica-set-option

0 commit comments

Comments
 (0)