@@ -123,18 +123,21 @@ def initialize(host=nil, port=nil, options={})
123
123
connect if should_connect
124
124
end
125
125
126
- # Initialize a paired connection to MongoDB.
126
+ # Initialize a connection to a MongoDB replica set using an array of seed nodes .
127
127
#
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.
129
133
# @param opts Takes the same options as Connection.new
130
134
#
131
135
# @example
132
- # Connection.paired ([["db1.example.com", 27017],
136
+ # Connection.multi ([["db1.example.com", 27017],
133
137
# ["db2.example.com", 27017]])
134
138
#
135
139
# @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]],
138
141
# :pool_size => 20, :timeout => 5)
139
142
#
140
143
# @return [Mongo::Connection]
0 commit comments