Skip to content

Commit db27756

Browse files
committed
minor: docs
1 parent 2435597 commit db27756

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/mongo/connection.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,21 @@ def initialize(host=nil, port=nil, options={})
123123
connect if should_connect
124124
end
125125

126-
# Initialize a paired connection to MongoDB.
126+
# Initialize a connection to a MongoDB replica set using an array of seed nodes.
127127
#
128-
# @param nodes [Array] An array of arrays, each of which specified a host and port.
128+
# Note that, even when connecting to a replica set, you can use Connection.new specifying
129+
# just a single node. If the replica set is up, the remaining nodes in the set will be cached
130+
# for failover.
131+
#
132+
# @param nodes [Array] An array of arrays, each of which specifies a host and port.
129133
# @param opts Takes the same options as Connection.new
130134
#
131135
# @example
132-
# Connection.paired([["db1.example.com", 27017],
136+
# Connection.multi([["db1.example.com", 27017],
133137
# ["db2.example.com", 27017]])
134138
#
135139
# @example
136-
# Connection.paired([["db1.example.com", 27017],
137-
# ["db2.example.com", 27017]],
140+
# Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017], ["db3.example.com", 27017]],
138141
# :pool_size => 20, :timeout => 5)
139142
#
140143
# @return [Mongo::Connection]

0 commit comments

Comments
 (0)