Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into sasl

  • Loading branch information...
commit b3b57b1fbfcedd8c980508010e5ddd313f92338e 2 parents 3be1249 + cd9a2d1
@christkv christkv authored
Showing with 23 additions and 23 deletions.
  1. +22 −22 docs/articles/MongoClient.md
  2. +1 −1  lib/mongodb/collection.js
View
44 docs/articles/MongoClient.md
@@ -178,7 +178,7 @@ The url format can be used with MongoClient.connect. Where possible MongoClient
Notice that when connecting to the sharded system it's pretty much the same url as for connecting to the replicaset. This is because the driver itself figures out if it's a replicaset or a set of Mongos proxies it's connecting to. No special care is needed to specify if it's one or the other. This is in contrast to having to use the **ReplSet** or **Mongos** instances when using the **open** command.
## MongoClient.connect options
-The connect function also takes a hash of options divided into db/server/replset/mongos allowing you to tweak options not directly supported by the unified url string format. To use these options you do pass in a has like this.
+The connect function also takes a hash of options divided into db/server/replset/mongos allowing you to tweak options not directly supported by the unified url string format. To use these options you do pass in a hash like this:
var MongoClient = require('mongodb').MongoClient;
@@ -224,28 +224,28 @@ Below are all the options supported for db/server/replset/mongos.
* **numberOfRetries** {Number, default:5}, number of retries off connection.
## server: A hash of options at the server level not supported by the url.
- * **readPreference** {String, default:null}, set's the read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST)
- * **ssl** {Boolean, default:false}, use ssl connection (needs to have a mongod server with ssl support)
- * **slaveOk** {Boolean, default:false}, legacy option allowing reads from secondary, use **readPrefrence** instead.
- * **poolSize** {Number, default:1}, number of connections in the connection pool, set to 1 as default for legacy reasons.
- * **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), connectTimeoutMS:(number), socketTimeoutMS:(number))
- * **logger** {Object, default:null}, an object representing a logger that you want to use, needs to support functions debug, log, error **({error:function(message, object) {}, log:function(message, object) {}, debug:function(message, object) {}})**.
- * **auto_reconnect** {Boolean, default:false}, reconnect on error.
- * **disableDriverBSONSizeCheck** {Boolean, default:false}, force the server to error if the BSON message is to big
+ * **readPreference** {String, default:null}, set's the read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST)
+ * **ssl** {Boolean, default:false}, use ssl connection (needs to have a mongod server with ssl support)
+ * **slaveOk** {Boolean, default:false}, legacy option allowing reads from secondary, use **readPrefrence** instead.
+ * **poolSize** {Number, default:1}, number of connections in the connection pool, set to 1 as default for legacy reasons.
+ * **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), connectTimeoutMS:(number), socketTimeoutMS:(number))
+ * **logger** {Object, default:null}, an object representing a logger that you want to use, needs to support functions debug, log, error **({error:function(message, object) {}, log:function(message, object) {}, debug:function(message, object) {}})**.
+ * **auto_reconnect** {Boolean, default:false}, reconnect on error.
+ * **disableDriverBSONSizeCheck** {Boolean, default:false}, force the server to error if the BSON message is to big
## replSet: A hash of options at the replSet level not supported by the url.
- * **ha** {Boolean, default:true}, turn on high availability.
- * **haInterval** {Number, default:2000}, time between each replicaset status check.
- * **reconnectWait** {Number, default:1000}, time to wait in milliseconds before attempting reconnect.
- * **retries** {Number, default:30}, number of times to attempt a replicaset reconnect.
- * **rs_name** {String}, the name of the replicaset to connect to.
- * **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), connectTimeoutMS:(number), socketTimeoutMS:(number))
- * **readPreference** {String}, the preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
- * **strategy** {String, default:null}, selection strategy for reads choose between (ping and statistical, default is round-robin)
- * **secondaryAcceptableLatencyMS** {Number, default:15}, sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms)
- * **connectArbiter** {Boolean, default:false}, sets if the driver should connect to arbiters or not.
+ * **ha** {Boolean, default:true}, turn on high availability.
+ * **haInterval** {Number, default:2000}, time between each replicaset status check.
+ * **reconnectWait** {Number, default:1000}, time to wait in milliseconds before attempting reconnect.
+ * **retries** {Number, default:30}, number of times to attempt a replicaset reconnect.
+ * **rs_name** {String}, the name of the replicaset to connect to.
+ * **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), connectTimeoutMS:(number), socketTimeoutMS:(number))
+ * **readPreference** {String}, the preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * **strategy** {String, default:null}, selection strategy for reads choose between (ping and statistical, default is round-robin)
+ * **secondaryAcceptableLatencyMS** {Number, default:15}, sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms)
+ * **connectArbiter** {Boolean, default:false}, sets if the driver should connect to arbiters or not.
## mongos: A hash of options at the mongos level not supported by the url.
- * **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), connectTimeoutMS:(number), socketTimeoutMS:(number))
- * **ha** {Boolean, default:true}, turn on high availability, attempts to reconnect to down proxies
- * **haInterval** {Number, default:2000}, time between each replicaset status check.
+ * **socketOptions** {Object, default:null}, an object containing socket options to use (noDelay:(boolean), keepAlive:(number), connectTimeoutMS:(number), socketTimeoutMS:(number))
+ * **ha** {Boolean, default:true}, turn on high availability, attempts to reconnect to down proxies
+ * **haInterval** {Number, default:2000}, time between each replicaset status check.
View
2  lib/mongodb/collection.js
@@ -758,7 +758,7 @@ Collection.prototype.findAndRemove = function(query, sort, options, callback) {
var testForFields = {
limit: 1, sort: 1, fields:1, skip: 1, hint: 1, explain: 1, snapshot: 1, timeout: 1, tailable: 1, tailableRetryInterval: 1
, numberOfRetries: 1, awaitdata: 1, exhaust: 1, batchSize: 1, returnKey: 1, maxScan: 1, min: 1, max: 1, showDiskLoc: 1
- , comment: 1, raw: 1, readPreference: 1, numberOfRetries: 1, partial: 1, read: 1, dbName: 1
+ , comment: 1, raw: 1, readPreference: 1, partial: 1, read: 1, dbName: 1
};
/**
Please sign in to comment.
Something went wrong with that request. Please try again.