This repository was archived by the owner on Feb 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 327
/
Copy pathclass.mongoexception.html
270 lines (234 loc) · 7.76 KB
/
class.mongoexception.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>The MongoException class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />
</head>
<body class="docs"><div class="navbar navbar-fixed-top">
<div class="navbar-inner clearfix">
<ul class="nav" style="width: 100%">
<li style="float: left;"><a href="mongo.exceptions.html">« Exceptions</a></li>
<li style="float: right;"><a href="class.mongoresultexception.html">MongoResultException »</a></li>
</ul>
</div>
</div>
<div id="breadcrumbs" class="clearfix">
<ul class="breadcrumbs-container">
<li><a href="index.html">PHP Manual</a></li>
<li><a href="mongo.exceptions.html">Exceptions</a></li>
<li>The MongoException class</li>
</ul>
</div>
<div id="layout">
<div id="layout-content"><div id="class.mongoexception" class="reference">
<h1 class="title">The MongoException class</h1>
<div class="partintro"><p class="verinfo">(PECL mongo >= 1.0.0)</p>
<div class="section" id="mongoexception.intro">
<h2 class="title">Introduction</h2>
<p class="para">
Default Mongo exception.
</p>
<p class="para">
This covers a bunch of different error conditions that may eventually be
moved to more specific exceptions, but will always extend
<strong class="classname">MongoException</strong>.
</p>
<ul class="itemizedlist">
<li class="listitem">
<p class="para">
<code class="literal">The MongoSomething object has not been correctly initialized by its constructor</code>
</p>
<p class="para">
Code: 0
</p>
<p class="para">
Probably your Mongo object is not connected to a database server.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">zero-length keys are not allowed, did you use $ with double quotes?</code>
</p>
<p class="para">
Code: 1
</p>
<p class="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
<a href="mongo.configuration.html#ini.mongo.allow-empty-keys" class="link">mongo.allow_empty_keys</a>
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.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">'.' not allowed in key: <key></code>
</p>
<p class="para">
Code: 2
</p>
<p class="para">
You attempted to write a key with '.' in it, which is prohibited.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">insert too large: <size>, max: <max></code>
</p>
<p class="para">
Code: 3
</p>
<p class="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).
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">no elements in doc</code>
</p>
<p class="para">
Code: 4
</p>
<p class="para">
You're attempting to save a document with no fields.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">size of BSON doc is <size> bytes, max <max>MB</code>
</p>
<p class="para">
Code: 5
</p>
<p class="para">
You're attempting to save a document that is larger than MongoDB can save.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">no documents given</code>
</p>
<p class="para">
Code: 6
</p>
<p class="para">
You're attempting to batch insert an empty array of documents.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">MongoCollection::group takes an array, object, or MongoCode key</code>
</p>
<p class="para">
Code: 7
</p>
<p class="para">
Wrong type parameter send to <span class="function"><a href="mongocollection.group.html" class="function">MongoCollection::group()</a></span>.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">field names must be strings</code>
</p>
<p class="para">
Code: 8
</p>
<p class="para">
You should format field selectors as
<code class="literal">array("field1" => 1, "field2" => 1, ..., "fieldN" => 1)</code>.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">invalid regex</code>
</p>
<p class="para">
Code: 9
</p>
<p class="para">
The regex passed to <a href="class.mongoregex.html" class="classname">MongoRegex</a> is not of the
correct form.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">MongoDBRef::get: $ref field must be a string</code>
</p>
<p class="para">
Code: 10
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">MongoDBRef::get: $db field must be a string</code>
</p>
<p class="para">
Code: 11
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">non-utf8 string: <str></code>
</p>
<p class="para">
Code: 12
</p>
<p class="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.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">mutex error: <err></code>
</p>
<p class="para">
Code: 13
</p>
<p class="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.
</p>
</li>
<li class="listitem">
<p class="para">
<code class="literal">index name too long: <len>, max <max> characters</code>
</p>
<p class="para">
Code: 14
</p>
<p class="para">
Indexes with names longer than 128 characters cannot be created. If you
get this error, you should use
<span class="function"><a href="mongocollection.ensureindex.html" class="function">MongoCollection::ensureIndex()</a></span>'s "name" option to
create a shorter name for your index.
</p>
</li>
</ul>
</div>
<div class="section" id="mongoexception.synopsis">
<h2 class="title">Class synopsis</h2>
<div class="classsynopsis">
<div class="ooclass"></div>
<div class="classsynopsisinfo">
<span class="ooclass">
<strong class="classname">MongoException</strong>
</span>
<span class="ooclass">
<span class="modifier">extends</span>
<strong class="classname">Exception</strong>
</span>
{</div>
}</div>
</div>
</div>
</div>
</div></div></body></html>