You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though the pooling architecture will undoubtedly evolve, it currently owes much credit
@@ -168,13 +168,13 @@ of v1.3.0, the Ruby driver detects forking and reconnects automatically.
168
168
169
169
## Environment variable `MONGODB_URI`
170
170
171
-
`Mongo::Client.from_uri`, `Mongo::Client.new` and `Mongo::ReplSetClient.new` will use <code>ENV["MONGODB_URI"]</code> if no other args are provided.
171
+
`Mongo::MongoClient.from_uri`, `Mongo::MongoClient.new` and `Mongo::MongoReplicaSetClient.new` will use <code>ENV["MONGODB_URI"]</code> if no other args are provided.
If the type of connection (direct or replica set) should be determined entirely from <code>ENV["MONGODB_URI"]</code>, you may want to use `Mongo::Client.from_uri` because it will return either `Mongo::Client` or a `Mongo::ReplSetClient` depending on how many hosts are specified. Trying to use `Mongo::Client.new` with multiple hosts in <code>ENV["MONGODB_URI"]</code> will raise an exception.
177
+
If the type of connection (direct or replica set) should be determined entirely from <code>ENV["MONGODB_URI"]</code>, you may want to use `Mongo::MongoClient.from_uri` because it will return either `Mongo::MongoClient` or a `Mongo::MongoReplicaSetClient` depending on how many hosts are specified. Trying to use `Mongo::MongoClient.new` with multiple hosts in <code>ENV["MONGODB_URI"]</code> will raise an exception.
178
178
179
179
## String Encoding
180
180
@@ -204,10 +204,10 @@ generate _id values. If you want to control _id values or even their types,
204
204
using a PK factory lets you do so.
205
205
206
206
You can tell the Ruby Mongo driver how to create primary keys by passing in
207
-
the :pk option to the Client#db method.
207
+
the :pk option to the MongoClient#db method.
208
208
209
209
```ruby
210
-
db =Mongo::Client.new('localhost', 27017).db('dbname', :pk => MyPKFactory.new)
210
+
db =Mongo::MongoClient.new('localhost', 27017).db('dbname', :pk => MyPKFactory.new)
211
211
```
212
212
213
213
A primary key factory object must respond to :create_pk, which should
@@ -263,7 +263,7 @@ To turn on strict mode, either pass in :strict => true when obtaining a DB
263
263
object or call the `:strict=` method:
264
264
265
265
```ruby
266
-
db =Client.new('localhost', 27017).db('dbname', :strict => true)
266
+
db =MongoClient.new('localhost', 27017).db('dbname', :strict => true)
267
267
# I'm feeling lax
268
268
db.strict =false
269
269
# No, I'm not!
@@ -287,10 +287,10 @@ Notes:
287
287
## Socket timeouts
288
288
289
289
The Ruby driver support timeouts on socket read operations. To enable them, set the
290
-
`:op_timeout` option when you create a `Mongo::Client` object.
290
+
`:op_timeout` option when you create a `Mongo::MongoClient` object.
291
291
292
292
If implementing higher-level timeouts, using tools like `Rack::Timeout`, it's very important
293
-
to call `Mongo::Client#close` to prevent the subsequent operation from receiving the previous
293
+
to call `Mongo::MongoClient#close` to prevent the subsequent operation from receiving the previous
0 commit comments