Predefined Constants

MongoDB Log Levels

MongoDB::PROFILING_OFF

0

Profiling is off.

MongoDB::PROFILING_SLOW

1

Profiling is on for slow operations (>100 ms).

MongoDB::PROFILING_ON

2

Profiling is on for all operations.

Fields

w

1

The number of servers to replicate a change to before returning success.
Inherited by instances of MongoCollection derived
from this. w functionality is only available in
version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver.

For example, if w is 2, the primary and one secondary
must have a record of the operation or the driver will throw a
MongoCursorException. It is tempting to set
w to the total number of secondaries + primary, but
then if one secondary is down the operation will fail and an exception
will be thrown, so usually w=2 is safest (primary and
one secondary).

wtimeout

10000

The number of milliseconds to wait for MongoDB::$w
replications to take place. Inherited by instances of
MongoCollection derived from this.
w functionality is only available in version 1.5.1+ of
the MongoDB server and 1.0.8+ of the driver.

Unless wtimeout is set, the server waits forever for
replicating to w servers to finish. The driver
defaults to waiting for 10 seconds, you can change this value to alter
its behavior.