2009-07-07 21:34:30 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
2009-07-11 08:06:30 +00:00
|
|
|
<!-- $Revision$ -->
|
2009-07-07 21:34:30 +00:00
|
|
|
<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>
|
2010-02-25 23:00:38 +00:00
|
|
|
|
|
|
|
<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>
|
2010-11-05 21:42:01 +00:00
|
|
|
|
|
|
|
<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
|
2012-01-12 12:40:04 +00:00
|
|
|
<link linkend="ini.mongo.allow-empty-keys">mongo.allow_empty_keys</link>
|
2010-11-05 21:42:01 +00:00
|
|
|
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>
|
2012-07-06 15:11:23 +00:00
|
|
|
Code: 9
|
2010-11-05 21:42:01 +00:00
|
|
|
</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>
|
|
|
|
|
2010-02-25 23:00:38 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-11-05 21:42:01 +00:00
|
|
|
<literal>non-utf8 string: <str></literal>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Code: 12
|
2010-02-25 23:00:38 +00:00
|
|
|
</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>
|
2010-11-05 21:42:01 +00:00
|
|
|
|
2010-02-25 23:00:38 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-11-05 21:42:01 +00:00
|
|
|
<literal>mutex error: <err></literal>
|
2010-02-25 23:00:38 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2010-11-05 21:42:01 +00:00
|
|
|
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.
|
2010-02-25 23:00:38 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2010-11-05 21:42:01 +00:00
|
|
|
|
2010-02-25 23:00:38 +00:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2011-02-21 21:43:09 +00:00
|
|
|
<literal>index name too long: <len>, max <max> characters</literal>
|
2010-02-25 23:00:38 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2010-11-05 21:42:01 +00:00
|
|
|
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.
|
2010-02-25 23:00:38 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2010-11-05 21:42:01 +00:00
|
|
|
|
2010-02-25 23:00:38 +00:00
|
|
|
</itemizedlist>
|
2009-07-07 21:34:30 +00:00
|
|
|
</section>
|
|
|
|
<!-- }}} -->
|
|
|
|
|
|
|
|
<section xml:id="mongoexception.synopsis">
|
|
|
|
&reftitle.classsynopsis;
|
|
|
|
|
|
|
|
<!-- {{{ Synopsis -->
|
|
|
|
<classsynopsis>
|
|
|
|
<ooclass><classname>MongoException</classname></ooclass>
|
|
|
|
|
|
|
|
<!-- {{{ Class synopsis -->
|
|
|
|
<classsynopsisinfo>
|
2012-11-29 05:37:54 +00:00
|
|
|
<ooclass>
|
|
|
|
<classname>MongoException</classname>
|
|
|
|
</ooclass>
|
2009-07-07 21:34:30 +00:00
|
|
|
<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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2009-07-07 21:34:30 +00:00
|
|
|
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
|
|
|
|
-->
|