<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <phpdoc:classref xml:id="class.mongoexception" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The MongoException class</title> <titleabbrev>MongoException</titleabbrev> <partintro> <!-- {{{ MongoException intro --> <section xml:id="mongoexception.intro"> &reftitle.intro; <para> Default Mongo exception. </para> <para> This covers a bunch of different error conditions that may eventually be moved to more specific exceptions, but will always extend <classname>MongoException</classname>. </para> <itemizedlist> <listitem> <para> <literal>The MongoSomething object has not been correctly initialized by its constructor</literal> </para> <para> Code: 0 </para> <para> Probably your Mongo object is not connected to a database server. </para> </listitem> <listitem> <para> <literal>zero-length keys are not allowed, did you use $ with double quotes?</literal> </para> <para> Code: 1 </para> <para> 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 <link linkend="ini.mongo.allow-empty-keys">mongo.allow_empty_keys</link> 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. </para> </listitem> <listitem> <para> <literal>'.' not allowed in key: <key></literal> </para> <para> Code: 2 </para> <para> You attempted to write a key with '.' in it, which is prohibited. </para> </listitem> <listitem> <para> <literal>insert too large: <size>, max: <max></literal> </para> <para> Code: 3 </para> <para> 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). </para> </listitem> <listitem> <para> <literal>no elements in doc</literal> </para> <para> Code: 4 </para> <para> You're attempting to save a document with no fields. </para> </listitem> <listitem> <para> <literal>size of BSON doc is <size> bytes, max <max>MB</literal> </para> <para> Code: 5 </para> <para> You're attempting to save a document that is larger than MongoDB can save. </para> </listitem> <listitem> <para> <literal>no documents given</literal> </para> <para> Code: 6 </para> <para> You're attempting to batch insert an empty array of documents. </para> </listitem> <listitem> <para> <literal>MongoCollection::group takes an array, object, or MongoCode key</literal> </para> <para> Code: 7 </para> <para> Wrong type parameter send to <function>MongoCollection::group</function>. </para> </listitem> <listitem> <para> <literal>field names must be strings</literal> </para> <para> Code: 8 </para> <para> You should format field selectors as <literal>array("field1" => 1, "field2" => 1, ..., "fieldN" => 1)</literal>. </para> </listitem> <listitem> <para> <literal>invalid regex</literal> </para> <para> Code: 8 </para> <para> The regex passed to <classname>MongoRegex</classname> is not of the correct form. </para> </listitem> <listitem> <para> <literal>MongoDBRef::get: $ref field must be a string</literal> </para> <para> Code: 10 </para> </listitem> <listitem> <para> <literal>MongoDBRef::get: $db field must be a string</literal> </para> <para> Code: 11 </para> </listitem> <listitem> <para> <literal>non-utf8 string: <str></literal> </para> <para> Code: 12 </para> <para> 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. </para> </listitem> <listitem> <para> <literal>mutex error: <err></literal> </para> <para> Code: 13 </para> <para> 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. </para> </listitem> <listitem> <para> <literal>index name too long: <len>, max <max> characters</literal> </para> <para> Code: 14 </para> <para> Indexes with names longer than 128 characters cannot be created. If you get this error, you should use <function>MongoCollection::ensureIndex</function>'s "name" option to create a shorter name for your index. </para> </listitem> </itemizedlist> </section> <!-- }}} --> <section xml:id="mongoexception.synopsis"> &reftitle.classsynopsis; <!-- {{{ Synopsis --> <classsynopsis> <ooclass><classname>MongoException</classname></ooclass> <!-- {{{ Class synopsis --> <classsynopsisinfo> <ooclass> <modifier>extends</modifier> <classname>Exception</classname> </ooclass> </classsynopsisinfo> <!-- }}} --> </classsynopsis> <!-- }}} --> </section> </partintro> </phpdoc:classref> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->