Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mongoexception(3) [php man page]

MONGOEXCEPTION(3)							 1							 MONGOEXCEPTION(3)

The MongoException class

INTRODUCTION
Default Mongo exception. This covers a bunch of different error conditions that may eventually be moved to more specific exceptions, but will always extend Mon- goException. o The MongoSomething object has not been correctly initialized by its constructor Code: 0 Probably your Mongo object is not con- nected to a database server. o zero-length keys are not allowed, did you use $ with double quotes? Code: 1 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. o '.' not allowed in key: <key> Code: 2 You attempted to write a key with '.' in it, which is prohibited. o insert too large: <size>, max: <max> Code: 3 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). o no elements in doc Code: 4 You're attempting to save a document with no fields. o size of BSON doc is <size> bytes, max <max>MB Code: 5 You're attempting to save a document that is larger than MongoDB can save. o no documents given Code: 6 You're attempting to batch insert an empty array of documents. o MongoCollection::group takes an array, object, or MongoCode key Code: 7 Wrong type parameter send to MongoCollection.group(3). o field names must be strings Code: 8 You should format field selectors as array("field1" => 1, "field2" => 1, ..., "fieldN" => 1). o invalid regex Code: 9 The regex passed to MongoRegex is not of the correct form. o MongoDBRef::get: $ref field must be a string Code: 10 o MongoDBRef::get: $db field must be a string Code: 11 o non-utf8 string: <str> Code: 12 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. o mutex error: <err> Code: 13 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. o index name too long: <len>, max <max> characters Code: 14 Indexes with names longer than 128 characters cannot be created. If you get this error, you should use MongoCollection.ensureIndex(3)'s "name" option to create a shorter name for your index. CLASS SYNOPSIS
MongoException MongoExceptionextends Exception PHP Documentation Group MONGOEXCEPTION(3)

Check Out this Related Man Page

MONGOCOLLECTION(3)							 1							MONGOCOLLECTION(3)

The MongoCollection class

INTRODUCTION
Represents a MongoDB collection. Collection names can use any character in the ASCII set. Some valid collection names are "", "...", "my collection", and "*&#@". User-defined collection names cannot contain the $ symbol. There are certain system collections which use a $ in their names (e.g., local.oplog.$main), but it is a reserved character. If you attempt to create and use a collection with a $ in the name, MongoDB will assert. CLASS SYNOPSIS
MongoCollection MongoCollection Constants o const int$MongoCollection::ASCENDING1 o const int$MongoCollection::DESCENDING-1 Fields o public MongoDB$db NULL o public integer$w o public integer$wtimeout Methods o public array MongoCollection::aggregate (array $pipeline, [array $options]) o public MongoCommandCursor MongoCollection::aggregateCursor (array $command, [array $options]) o public mixed MongoCollection::batchInsert (array $a, [array $options = array()]) o public MongoCollection::__construct (MongoDB $db, string $name) o public int MongoCollection::count ([array $query = array()], [array $options = array()]) o public array MongoCollection::createDBRef (mixed $document_or_id) o public bool MongoCollection::createIndex (array $keys, [array $options = array()]) o public array MongoCollection::deleteIndex (string|array $keys) o public array MongoCollection::deleteIndexes (void ) o public array MongoCollection::distinct (string $key, [array $query]) o public array MongoCollection::drop (void ) o public bool MongoCollection::ensureIndex (string|array $key|keys, [array $options = array()]) o public MongoCursor MongoCollection::find ([array $query = array()], [array $fields = array()]) o public array MongoCollection::findAndModify (array $query, [array $update], [array $fields], [array $options]) o public array MongoCollection::findOne ([array $query = array()], [array $fields = array()], [array $options = array()]) o public MongoCollection MongoCollection::__get (string $name) o public array MongoCollection::getDBRef (array $ref) o public array MongoCollection::getIndexInfo (void ) o public string MongoCollection::getName (void ) o public array MongoCollection::getReadPreference (void ) o public bool MongoCollection::getSlaveOkay (void ) o public array MongoCollection::getWriteConcern (void ) o public array MongoCollection::group (mixed $keys, array $initial, MongoCode $reduce, [array $options = array()]) o public bool|array MongoCollection::insert (array|object $document, [array $options = array()]) o public array[MongoCommandCursor] MongoCollection::parallelCollectionScan (int $num_cursors) o public bool|array MongoCollection::remove ([array $criteria = array()], [array $options = array()]) o public mixed MongoCollection::save (array|object $document, [array $options = array()]) o public bool MongoCollection::setReadPreference (string $read_preference, [array $tags]) o public bool MongoCollection::setSlaveOkay ([bool $ok = true]) o public bool MongoCollection::setWriteConcern (mixed $w, [int $wtimeout]) o static protected string MongoCollection::toIndexString (mixed $keys) o public string MongoCollection::__toString (void ) o public bool|array MongoCollection::update (array $criteria, array $new_object, [array $options = array()]) o public array MongoCollection::validate FALSE ([bool $scan_data]) PREDEFINED CONSTANTS
o MongoCollection::ASCENDING - 1 - Ascending direction for sorts and index creation. o MongoCollection::DESCENDING - -1 - Descending direction for sorts and index creation. FIELDS
o $db - The "parent" database for this collection. o $w - The number of servers to replicate a change to before returning success. Value is inherited from the parent database. The Mon- goDB class has a more detailed description of how w works. o $wtimeout - The number of milliseconds to wait for $this->w replications to take place. Value is inherited from the parent database. The MongoDB class has a more detailed description of how wtimeout works. SEE ALSO
MongoDB core docs on collections. PHP Documentation Group MONGOCOLLECTION(3)
Man Page