Skip to content

How to set MongoOptions

marcesher edited this page Jun 8, 2011 · 1 revision

The Mongo Java API exposes a [MongoOptions](http://api.mongodb.org/java/current/) object, in which you can set such things as connectionTimeout, maxWaitTime, etc.

Currently, CFMongoDB does not provide for this in its constructor, though that will most likely be forthcoming. Meanwhile, you can set options like so:


... init a cfmongodb object..., then:
var options = mongo.getMongo().getMongoOptions();
options.socketTimeout=1000;
... etc

See the MongoOptions API for settable properties.

Clone this wiki locally