@@ -4,7 +4,7 @@ msgstr ""
4
4
"Project-Id-Version : mongodb-manual 3.2\n "
5
5
"Report-Msgid-Bugs-To : \n "
6
6
"POT-Creation-Date : 2016-05-31 19:15-0400\n "
7
- "PO-Revision-Date : 2016-08-12 15:34 +0800\n "
7
+ "PO-Revision-Date : 2016-08-13 17:06 +0800\n "
8
8
"MIME-Version : 1.0\n "
9
9
"Content-Type : text/plain; charset=UTF-8\n "
10
10
"Content-Transfer-Encoding : 8bit\n "
@@ -118,6 +118,7 @@ msgid ""
118
118
"document that wholly replaces the matching documents except for the ``_id`` "
119
119
"field, and"
120
120
msgstr ""
121
+ "更新文档----指定要执行的修改或替换文档---完全替换匹配文档(除了 ``_id`` 字段)"
121
122
122
123
#: ../source/tutorial/update-documents.txt:68
123
124
msgid "an options document."
@@ -150,6 +151,8 @@ msgid ""
150
151
"replace an existing document with a replacement document that has a "
151
152
"different ``_id`` field value."
152
153
msgstr ""
154
+ "一旦设定,你不能更新 ``_id`` 字段的值,你也不能用有不同 ``_id`` 字段值的替换文"
155
+ "档替换已经存在的文档."
153
156
154
157
#: ../source/tutorial/update-documents.txt:88
155
158
msgid "Document Size"
@@ -162,6 +165,8 @@ msgid ""
162
165
"the allocated space for that document, the update operation relocates the "
163
166
"document on disk."
164
167
msgstr ""
168
+ "当执行更新操作增加了文档大小,超过了为该文档分配的空间时,更新操作会在磁盘上重"
169
+ "定位该文档."
165
170
166
171
#: ../source/tutorial/update-documents.txt:95
167
172
msgid "Field Order"
@@ -171,24 +176,28 @@ msgstr "字段顺序"
171
176
msgid ""
172
177
"MongoDB preserves the order of the document fields following write "
173
178
"operations *except* for the following cases:"
174
- msgstr ""
179
+ msgstr "MongoDB遵循写操作保持文档字段顺序,*除了* 如下的情况: "
175
180
176
181
#: ../source/includes/fact-update-field-order.rst:10
177
182
msgid "The ``_id`` field is always the first field in the document."
178
- msgstr ""
183
+ msgstr "``-id`` 字段始终是文档中的第一个字段. "
179
184
180
185
#: ../source/includes/fact-update-field-order.rst:12
181
186
msgid ""
182
187
"Updates that include :update:`renaming <$rename>` of field names may result "
183
188
"in the reordering of fields in the document."
184
189
msgstr ""
190
+ "更新中包括 :update:`renaming <$rename>` 字段名称 可能会导致文档中的字段重新"
191
+ "排序."
185
192
186
193
#: ../source/includes/fact-update-field-order.rst:17
187
194
msgid ""
188
195
"Starting in version 2.6, MongoDB actively attempts to preserve the field "
189
196
"order in a document. Before version 2.6, MongoDB did not actively preserve "
190
197
"the order of the fields in a document."
191
198
msgstr ""
199
+ "在2.6版本开始,MongoDB主动尝试保持在文档中的字段的顺序。 2.6版本之前,MongoDB"
200
+ "不会主动保持文档中的字段的顺序。"
192
201
193
202
#: ../source/tutorial/update-documents.txt:102
194
203
msgid "``Upsert`` Option"
@@ -203,12 +212,17 @@ msgid ""
203
212
"If there are matching documents, then the operation modifies or replaces "
204
213
"the matching document or documents."
205
214
msgstr ""
215
+ "如果 :method:`db.collection.update()`, :method:`db.collection."
216
+ "updateOne()`, :method:`db.collection.updateMany()`, 或者 :method:`db."
217
+ "collection.replaceOne()` 包含 ``upsert : true`` **并且** 没有文档匹配指定的"
218
+ "过滤器,那么此操作会创建一个新文档并插入它.如果有匹配的文档,那么此操作修改或"
219
+ "替换匹配的单个或多个文档."
206
220
207
221
#: ../source/tutorial/update-documents.txt:112
208
222
msgid ""
209
223
"For details on the new document created, see the individual reference pages "
210
224
"for the methods."
211
- msgstr ""
225
+ msgstr "有关创建新文档的细节,请参阅这些方法各自的参考页面. "
212
226
213
227
#: ../source/tutorial/update-documents.txt:116
214
228
msgid "Example Collection"
@@ -222,59 +236,75 @@ msgid ""
222
236
"cursor is automatically iterated up to 20 times [#set-shell-batch-size]_ to "
223
237
"print up to the first 20 documents in the results."
224
238
msgstr ""
239
+ "本页示例使用 :program:`mongo` shell中的 :method:`db.collection.find()` 方法."
240
+ "在 :program:`mongo` shell 中,如果返回的游标没有赋给使用 ``var`` 关键字的变"
241
+ "量,那么该游标会自动迭代20次 [#set-shell-batch-size]_ 来打印出结果中的前20个"
242
+ "文档."
225
243
226
244
#: ../source/tutorial/update-documents.txt:125
227
245
msgid ""
228
246
"To populate the ``users`` collection referenced in the examples, run the "
229
247
"following in :program:`mongo` shell:"
230
248
msgstr ""
249
+ "要添加示例中涉及的 ``users`` 集合,在 :program:`mongo` shell中运行如下命令:"
231
250
232
251
#: ../source/tutorial/update-documents.txt:130
233
252
msgid ""
234
253
"If the ``users`` collection already contains documents with the same "
235
254
"``_id`` values, you need to :method:`drop <db.collection.drop()>` the "
236
255
"collection (``db.users.drop()``) before inserting the example documents."
237
256
msgstr ""
257
+ "如果 ``users`` 集合中已经包含了相同 ``_id`` 值的文档,你需要在插入示例文档"
258
+ "前 :method:`drop <db.collection.drop()>` 该集合( ``db.users.drop()`` )."
238
259
239
260
#: ../source/tutorial/update-documents.txt:228
240
261
msgid "Update Specific Fields in a Document"
241
- msgstr ""
262
+ msgstr "更新文档中指定字段 "
242
263
243
264
#: ../source/tutorial/update-documents.txt:230
244
265
msgid ""
245
266
"To change a field in a document, MongoDB provides :manual:`update operators "
246
267
"</reference/operator/update>`, such as :update:`$set` to modify values."
247
268
msgstr ""
269
+ "为了修改文档中的字段,MongoDB 提供了 :manual:`update operators </reference/"
270
+ "operator/update>`,例如用来修改值的 :update:`$set` "
248
271
249
272
#: ../source/tutorial/update-documents.txt:234
250
273
msgid ""
251
274
"To specify the modification to perform using update operators, use an "
252
275
"update document of the form:"
253
- msgstr ""
276
+ msgstr "要用更新操作符指定要执行的修改,使用(如下)形式的更新文档: "
254
277
255
278
#: ../source/tutorial/update-documents.txt:245
256
279
msgid ""
257
280
"Some update operators, such as :update:`$set`, will create the field if the "
258
281
"field does not exist. See the individual :manual:`update operator </"
259
282
"reference/operator/update>` reference."
260
283
msgstr ""
284
+ "如果字段不存在,一些更新操作符,例如 :update:`$set`会创建该字段.请参阅单独"
285
+ "的 :manual:`update operator </reference/operator/update>` 参考."
261
286
262
287
#: ../source/tutorial/update-documents.txt:252
263
288
msgid "``db.collection.updateOne()``"
264
- msgstr ""
289
+ msgstr "``db.collection.updateOne()`` "
265
290
266
291
#: ../source/tutorial/update-documents.txt:256
267
292
msgid ""
268
293
"The following example uses the :method:`db.collection.updateOne()` method "
269
294
"on the ``users`` collection to update the *first* document that matches the "
270
295
"filter ``favorites.artist`` equals ``\" Picasso\" ``. The update operation:"
271
296
msgstr ""
297
+ "下面的例子对 ``users`` 集合使用 :method:`db.collection.updateOne()` 方法来更"
298
+ "新匹配过滤条件-- ``favorites.artist`` 等于 ``\" Picasso\" `` 的 *第一个* 文档."
299
+ "更新操作:"
272
300
273
301
#: ../source/tutorial/update-documents.txt:261
274
302
msgid ""
275
303
"uses the :update:`$set` operator to update the value of the ``favorites."
276
304
"food`` field to ``\" pie\" `` and the value of the ``type`` field to ``3``,"
277
305
msgstr ""
306
+ "使用 :update:`$set` 操作符更新 ``favorites.food`` 字段的值到 ``\" pie\" ``并更"
307
+ "新 ``type`` 字段的值到 ``3``,"
278
308
279
309
#: ../source/tutorial/update-documents.txt:265
280
310
#: ../source/tutorial/update-documents.txt:299
@@ -285,62 +315,77 @@ msgid ""
285
315
"not exist, :update:`$currentDate` will create the field. See :update:`"
286
316
"$currentDate` for details."
287
317
msgstr ""
318
+ "使用 :update:`$currentDate` 操作符更新 ``lastModified`` 字段的值到当前日期."
319
+ "如果 ``lastModified`` 字段不存在, :update:`$currentDate` 会创建该字段.详情"
320
+ "请参阅 :update:`$currentDate`."
288
321
289
322
#: ../source/tutorial/update-documents.txt:280
290
323
msgid ""
291
324
"For more information and examples, see :method:`db.collection.updateOne()`."
292
- msgstr ""
325
+ msgstr "更多信息和示例,请参阅 :method:`db.collection.updateOne()`. "
293
326
294
327
#: ../source/tutorial/update-documents.txt:287
295
328
msgid "``db.collection.updateMany()``"
296
- msgstr ""
329
+ msgstr "``db.collection.updateMany()`` "
297
330
298
331
#: ../source/tutorial/update-documents.txt:291
299
332
msgid ""
300
333
"The following example uses the :method:`db.collection.updateMany()` method "
301
334
"on the ``users`` collection to update all documents that matches the filter "
302
335
"``favorites.artist`` equals ``\" Picasso\" ``. The update operation:"
303
336
msgstr ""
337
+ "下面的例子对 ``users`` 集合使用 :method:`db.collection.updateMany()` 方法来"
338
+ "更新所有匹配过滤条件-- ``favorites.artist`` 等于 ``\" Picasso\" `` 的文档.更新"
339
+ "操作:"
304
340
305
341
#: ../source/tutorial/update-documents.txt:295
306
342
msgid ""
307
343
"uses the :update:`$set` operator to update the value of the ``favorites."
308
344
"artist`` field to ``\" Pisanello\" `` and the value of the ``type`` field to "
309
345
"``3``,"
310
346
msgstr ""
347
+ "使用 :update:`$set` 操作符更新 ``favorites.food`` 字段的值到 ``\" Pisanello"
348
+ "\" `` 并更新 ``type`` 字段的值到 ``3``,"
311
349
312
350
#: ../source/tutorial/update-documents.txt:314
313
351
msgid ""
314
352
"For more information and examples, see :method:`db.collection.updateMany()`."
315
- msgstr ""
353
+ msgstr "更多信息和示例,请参阅:方法:`db.collection.updateMany()`。 "
316
354
317
355
#: ../source/tutorial/update-documents.txt:318
318
356
#: ../source/tutorial/update-documents.txt:389
319
357
msgid "``db.collection.update``"
320
- msgstr ""
358
+ msgstr "``db.collection.update`` "
321
359
322
360
#: ../source/tutorial/update-documents.txt:320
323
361
msgid ""
324
362
"The following example uses the :method:`db.collection.update()` method on "
325
363
"the ``users`` collection to update the *first* document that matches the "
326
364
"filter ``favorites.artist`` equals ``\" Pisanello\" ``. The update operation:"
327
365
msgstr ""
366
+ "下面的例子对 ``users`` 集合使用 :method:`db.collection.update()` 方法来更新"
367
+ "匹配过滤条件-- ``favorites.artist`` 等于 ``\" Pisanello\" `` 的 *第一个* 文档."
368
+ "更新操作:"
328
369
329
370
#: ../source/tutorial/update-documents.txt:324
330
371
msgid ""
331
372
"uses the :update:`$set` operator to update the value of the ``favorites."
332
373
"food`` field to ``\" pizza\" `` and the value of the ``type`` field to ``0``,"
333
374
msgstr ""
375
+ "使用 :update:`$set` 操作符更新 ``favorites.food`` 字段的值到 ``\" pizza\" ``并"
376
+ "更新 ``type`` 字段的值到 ``0``,"
334
377
335
378
#: ../source/tutorial/update-documents.txt:343
336
379
msgid ""
337
380
"To update multiple documents using the :method:`db.collection.update()`, "
338
381
"include the :ref:`multi: true <multi-parameter>` option:"
339
382
msgstr ""
383
+ "使用 :method:`db.collection.update()`并包含 :ref:`multi: true <multi-"
384
+ "parameter>` 选项来更新多个文档:"
340
385
341
386
#: ../source/tutorial/update-documents.txt:359
342
387
msgid "Replace the Document"
343
- msgstr ""
388
+ msgstr "文档替换 "
344
389
345
390
#: ../source/tutorial/update-documents.txt:361
346
391
msgid ""
@@ -350,6 +395,9 @@ msgid ""
350
395
"replacing a document, the replacement document must consist of only "
351
396
"``<field> : <value>``."
352
397
msgstr ""
398
+ "要更新除 ``_id`` 字段的文档的整个内容,传递一个全新的文档给:method:`db."
399
+ "collection.replaceOne()` 给 :method:`db.collection.update()`作为第二个参数."
400
+ "当替换文档时,替换文档必须仅仅由 ``<field> : <value>`` 组成."
353
401
354
402
#: ../source/tutorial/update-documents.txt:367
355
403
msgid ""
@@ -358,24 +406,31 @@ msgid ""
358
406
"the ``_id`` field is immutable; however, if you do include the ``_id`` "
359
407
"field, it must have the same value as the current value."
360
408
msgstr ""
409
+ "替换文档可以有不同于原文档的字段.在替换文档中,由于 ``_id`` 字段是不变的,所"
410
+ "以,你可以省略 ``_id`` 字段;不论如何,如果你包含了 ``_id`` 字段,它的值必须和当"
411
+ "前的值相同."
361
412
362
413
#: ../source/tutorial/update-documents.txt:375
363
414
msgid "``db.collection.replaceOne``"
364
- msgstr ""
415
+ msgstr "``db.collection.replaceOne`` "
365
416
366
417
#: ../source/tutorial/update-documents.txt:377
367
418
msgid ""
368
419
"The following example uses the :method:`db.collection.replaceOne()` method "
369
420
"on the ``users`` collection to replace the *first* document that matches "
370
421
"the filter ``name`` equals ``\" sue\" `` with the new document:"
371
422
msgstr ""
423
+ "下面的例子对 ``users`` 集合使用 :method:`db.collection.replaceOne()` 将匹配"
424
+ "过滤条件--- ``name`` 等于 ``\" sue\" `` 的 *第一个* 文档替换为新文档:"
372
425
373
426
#: ../source/tutorial/update-documents.txt:391
374
427
msgid ""
375
428
"The following example uses the :method:`db.collection.update()` method on "
376
429
"the ``users`` collection to replace the *first* document that matches the "
377
430
"filter ``name`` equals ``\" xyz\" `` with the new document:"
378
431
msgstr ""
432
+ "下面的例子对 ``users`` 集合使用 :method:`db.collection.update()` 方法将匹配"
433
+ "过滤条件--- ``name`` 等于 ``\" xyz\" `` 的 *第一个* 文档替换为新文档:"
379
434
380
435
#: ../source/tutorial/update-documents.txt:403
381
436
msgid "Additional Methods"
0 commit comments