Default Mongo exception.
This covers a bunch of different error conditions that may eventually be moved to more specific exceptions, but will always extend MongoException.
The MongoSomething object has not been correctly initialized by its constructor
Probably your Mongo object is not connected to a database server.
zero-length keys are not allowed, did you use $ with double quotes?
You tried to save "" as a key. You generally should not do this. "" can mess up subobject access and is used by MongoDB internally. However, if you really want, you can set mongo.allow_empty_keys to true in your php.ini file to override this sanity check. If you override this, it is highly recommended that you set error checking to strict to avoid string interpolation errors.
'.' not allowed in key: <key>
You attempted to write a key with '.' in it, which is prohibited.
insert too large: <size>, max: <max>
You're attempting to send too much data to the database at once: the database will only accept inserts up to a certain size (currently 16 MB).
no elements in doc
You're attempting to save a document with no fields.
size of BSON doc is <size> bytes, max <max>MB
You're attempting to save a document that is larger than MongoDB can save.
no documents given
You're attempting to batch insert an empty array of documents.
MongoCollection::group takes an array, object, or MongoCode key
Wrong type parameter send to MongoCollection::group().
field names must be strings
You should format field selectors as array("field1" => 1, "field2" => 1, ..., "fieldN" => 1).
The regex passed to MongoRegex is not of the correct form.
MongoDBRef::get: $ref field must be a string
MongoDBRef::get: $db field must be a string
non-utf8 string: <str>
This error occurs if you attempt to send a non-utf8 string to the database. All strings going into the database should be UTF8. See php.ini options for the transition option of quieting this exception.
mutex error: <err>
The driver uses mutexes for synchronizing requests and responses in multithreaded environments. This is a fairly serious error and may not have a stack trace. It's unusual and should be reported to maintainers with any system information and steps to reproduce that you can provide.
index name too long: <len>, max <max> characters
Indexes with names longer than 128 characters cannot be created. If you get this error, you should use MongoCollection::ensureIndex()'s "name" option to create a shorter name for your index.