Skip to content

Commit e1a4fb2

Browse files
committed
tanslated "update document"(issue mongodb#1209)
1 parent f9176be commit e1a4fb2

File tree

1 file changed

+68
-13
lines changed

1 file changed

+68
-13
lines changed

locale/zh/LC_MESSAGES/tutorial/update-documents.po

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ msgstr ""
44
"Project-Id-Version: mongodb-manual 3.2\n"
55
"Report-Msgid-Bugs-To: \n"
66
"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"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=UTF-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -118,6 +118,7 @@ msgid ""
118118
"document that wholly replaces the matching documents except for the ``_id`` "
119119
"field, and"
120120
msgstr ""
121+
"更新文档----指定要执行的修改或替换文档---完全替换匹配文档(除了 ``_id`` 字段)"
121122

122123
#: ../source/tutorial/update-documents.txt:68
123124
msgid "an options document."
@@ -150,6 +151,8 @@ msgid ""
150151
"replace an existing document with a replacement document that has a "
151152
"different ``_id`` field value."
152153
msgstr ""
154+
"一旦设定,你不能更新 ``_id`` 字段的值,你也不能用有不同 ``_id`` 字段值的替换文"
155+
"档替换已经存在的文档."
153156

154157
#: ../source/tutorial/update-documents.txt:88
155158
msgid "Document Size"
@@ -162,6 +165,8 @@ msgid ""
162165
"the allocated space for that document, the update operation relocates the "
163166
"document on disk."
164167
msgstr ""
168+
"当执行更新操作增加了文档大小,超过了为该文档分配的空间时,更新操作会在磁盘上重"
169+
"定位该文档."
165170

166171
#: ../source/tutorial/update-documents.txt:95
167172
msgid "Field Order"
@@ -171,24 +176,28 @@ msgstr "字段顺序"
171176
msgid ""
172177
"MongoDB preserves the order of the document fields following write "
173178
"operations *except* for the following cases:"
174-
msgstr ""
179+
msgstr "MongoDB遵循写操作保持文档字段顺序,*除了* 如下的情况:"
175180

176181
#: ../source/includes/fact-update-field-order.rst:10
177182
msgid "The ``_id`` field is always the first field in the document."
178-
msgstr ""
183+
msgstr "``-id`` 字段始终是文档中的第一个字段."
179184

180185
#: ../source/includes/fact-update-field-order.rst:12
181186
msgid ""
182187
"Updates that include :update:`renaming <$rename>` of field names may result "
183188
"in the reordering of fields in the document."
184189
msgstr ""
190+
"更新中包括 :update:`renaming <$rename>` 字段名称 可能会导致文档中的字段重新"
191+
"排序."
185192

186193
#: ../source/includes/fact-update-field-order.rst:17
187194
msgid ""
188195
"Starting in version 2.6, MongoDB actively attempts to preserve the field "
189196
"order in a document. Before version 2.6, MongoDB did not actively preserve "
190197
"the order of the fields in a document."
191198
msgstr ""
199+
"在2.6版本开始,MongoDB主动尝试保持在文档中的字段的顺序。 2.6版本之前,MongoDB"
200+
"不会主动保持文档中的字段的顺序。"
192201

193202
#: ../source/tutorial/update-documents.txt:102
194203
msgid "``Upsert`` Option"
@@ -203,12 +212,17 @@ msgid ""
203212
"If there are matching documents, then the operation modifies or replaces "
204213
"the matching document or documents."
205214
msgstr ""
215+
"如果 :method:`db.collection.update()`, :method:`db.collection."
216+
"updateOne()`, :method:`db.collection.updateMany()`, 或者 :method:`db."
217+
"collection.replaceOne()` 包含 ``upsert : true`` **并且** 没有文档匹配指定的"
218+
"过滤器,那么此操作会创建一个新文档并插入它.如果有匹配的文档,那么此操作修改或"
219+
"替换匹配的单个或多个文档."
206220

207221
#: ../source/tutorial/update-documents.txt:112
208222
msgid ""
209223
"For details on the new document created, see the individual reference pages "
210224
"for the methods."
211-
msgstr ""
225+
msgstr "有关创建新文档的细节,请参阅这些方法各自的参考页面."
212226

213227
#: ../source/tutorial/update-documents.txt:116
214228
msgid "Example Collection"
@@ -222,59 +236,75 @@ msgid ""
222236
"cursor is automatically iterated up to 20 times [#set-shell-batch-size]_ to "
223237
"print up to the first 20 documents in the results."
224238
msgstr ""
239+
"本页示例使用 :program:`mongo` shell中的 :method:`db.collection.find()` 方法."
240+
"在 :program:`mongo` shell 中,如果返回的游标没有赋给使用 ``var`` 关键字的变"
241+
"量,那么该游标会自动迭代20次 [#set-shell-batch-size]_ 来打印出结果中的前20个"
242+
"文档."
225243

226244
#: ../source/tutorial/update-documents.txt:125
227245
msgid ""
228246
"To populate the ``users`` collection referenced in the examples, run the "
229247
"following in :program:`mongo` shell:"
230248
msgstr ""
249+
"要添加示例中涉及的 ``users`` 集合,在 :program:`mongo` shell中运行如下命令:"
231250

232251
#: ../source/tutorial/update-documents.txt:130
233252
msgid ""
234253
"If the ``users`` collection already contains documents with the same "
235254
"``_id`` values, you need to :method:`drop <db.collection.drop()>` the "
236255
"collection (``db.users.drop()``) before inserting the example documents."
237256
msgstr ""
257+
"如果 ``users`` 集合中已经包含了相同 ``_id`` 值的文档,你需要在插入示例文档"
258+
"前 :method:`drop <db.collection.drop()>` 该集合( ``db.users.drop()`` )."
238259

239260
#: ../source/tutorial/update-documents.txt:228
240261
msgid "Update Specific Fields in a Document"
241-
msgstr ""
262+
msgstr "更新文档中指定字段"
242263

243264
#: ../source/tutorial/update-documents.txt:230
244265
msgid ""
245266
"To change a field in a document, MongoDB provides :manual:`update operators "
246267
"</reference/operator/update>`, such as :update:`$set` to modify values."
247268
msgstr ""
269+
"为了修改文档中的字段,MongoDB 提供了 :manual:`update operators </reference/"
270+
"operator/update>`,例如用来修改值的 :update:`$set` "
248271

249272
#: ../source/tutorial/update-documents.txt:234
250273
msgid ""
251274
"To specify the modification to perform using update operators, use an "
252275
"update document of the form:"
253-
msgstr ""
276+
msgstr "要用更新操作符指定要执行的修改,使用(如下)形式的更新文档:"
254277

255278
#: ../source/tutorial/update-documents.txt:245
256279
msgid ""
257280
"Some update operators, such as :update:`$set`, will create the field if the "
258281
"field does not exist. See the individual :manual:`update operator </"
259282
"reference/operator/update>` reference."
260283
msgstr ""
284+
"如果字段不存在,一些更新操作符,例如 :update:`$set`会创建该字段.请参阅单独"
285+
"的 :manual:`update operator </reference/operator/update>` 参考."
261286

262287
#: ../source/tutorial/update-documents.txt:252
263288
msgid "``db.collection.updateOne()``"
264-
msgstr ""
289+
msgstr "``db.collection.updateOne()``"
265290

266291
#: ../source/tutorial/update-documents.txt:256
267292
msgid ""
268293
"The following example uses the :method:`db.collection.updateOne()` method "
269294
"on the ``users`` collection to update the *first* document that matches the "
270295
"filter ``favorites.artist`` equals ``\"Picasso\"``. The update operation:"
271296
msgstr ""
297+
"下面的例子对 ``users`` 集合使用 :method:`db.collection.updateOne()` 方法来更"
298+
"新匹配过滤条件-- ``favorites.artist`` 等于 ``\"Picasso\"`` 的 *第一个* 文档."
299+
"更新操作:"
272300

273301
#: ../source/tutorial/update-documents.txt:261
274302
msgid ""
275303
"uses the :update:`$set` operator to update the value of the ``favorites."
276304
"food`` field to ``\"pie\"`` and the value of the ``type`` field to ``3``,"
277305
msgstr ""
306+
"使用 :update:`$set` 操作符更新 ``favorites.food`` 字段的值到 ``\"pie\"``并更"
307+
"新 ``type`` 字段的值到 ``3``,"
278308

279309
#: ../source/tutorial/update-documents.txt:265
280310
#: ../source/tutorial/update-documents.txt:299
@@ -285,62 +315,77 @@ msgid ""
285315
"not exist, :update:`$currentDate` will create the field. See :update:`"
286316
"$currentDate` for details."
287317
msgstr ""
318+
"使用 :update:`$currentDate` 操作符更新 ``lastModified`` 字段的值到当前日期."
319+
"如果 ``lastModified`` 字段不存在, :update:`$currentDate` 会创建该字段.详情"
320+
"请参阅 :update:`$currentDate`."
288321

289322
#: ../source/tutorial/update-documents.txt:280
290323
msgid ""
291324
"For more information and examples, see :method:`db.collection.updateOne()`."
292-
msgstr ""
325+
msgstr "更多信息和示例,请参阅 :method:`db.collection.updateOne()`."
293326

294327
#: ../source/tutorial/update-documents.txt:287
295328
msgid "``db.collection.updateMany()``"
296-
msgstr ""
329+
msgstr "``db.collection.updateMany()``"
297330

298331
#: ../source/tutorial/update-documents.txt:291
299332
msgid ""
300333
"The following example uses the :method:`db.collection.updateMany()` method "
301334
"on the ``users`` collection to update all documents that matches the filter "
302335
"``favorites.artist`` equals ``\"Picasso\"``. The update operation:"
303336
msgstr ""
337+
"下面的例子对 ``users`` 集合使用 :method:`db.collection.updateMany()` 方法来"
338+
"更新所有匹配过滤条件-- ``favorites.artist`` 等于 ``\"Picasso\"`` 的文档.更新"
339+
"操作:"
304340

305341
#: ../source/tutorial/update-documents.txt:295
306342
msgid ""
307343
"uses the :update:`$set` operator to update the value of the ``favorites."
308344
"artist`` field to ``\"Pisanello\"`` and the value of the ``type`` field to "
309345
"``3``,"
310346
msgstr ""
347+
"使用 :update:`$set` 操作符更新 ``favorites.food`` 字段的值到 ``\"Pisanello"
348+
"\"`` 并更新 ``type`` 字段的值到 ``3``,"
311349

312350
#: ../source/tutorial/update-documents.txt:314
313351
msgid ""
314352
"For more information and examples, see :method:`db.collection.updateMany()`."
315-
msgstr ""
353+
msgstr "更多信息和示例,请参阅:方法:`db.collection.updateMany()`。"
316354

317355
#: ../source/tutorial/update-documents.txt:318
318356
#: ../source/tutorial/update-documents.txt:389
319357
msgid "``db.collection.update``"
320-
msgstr ""
358+
msgstr "``db.collection.update``"
321359

322360
#: ../source/tutorial/update-documents.txt:320
323361
msgid ""
324362
"The following example uses the :method:`db.collection.update()` method on "
325363
"the ``users`` collection to update the *first* document that matches the "
326364
"filter ``favorites.artist`` equals ``\"Pisanello\"``. The update operation:"
327365
msgstr ""
366+
"下面的例子对 ``users`` 集合使用 :method:`db.collection.update()` 方法来更新"
367+
"匹配过滤条件-- ``favorites.artist`` 等于 ``\"Pisanello\"`` 的 *第一个* 文档."
368+
"更新操作:"
328369

329370
#: ../source/tutorial/update-documents.txt:324
330371
msgid ""
331372
"uses the :update:`$set` operator to update the value of the ``favorites."
332373
"food`` field to ``\"pizza\"`` and the value of the ``type`` field to ``0``,"
333374
msgstr ""
375+
"使用 :update:`$set` 操作符更新 ``favorites.food`` 字段的值到 ``\"pizza\"``并"
376+
"更新 ``type`` 字段的值到 ``0``,"
334377

335378
#: ../source/tutorial/update-documents.txt:343
336379
msgid ""
337380
"To update multiple documents using the :method:`db.collection.update()`, "
338381
"include the :ref:`multi: true <multi-parameter>` option:"
339382
msgstr ""
383+
"使用 :method:`db.collection.update()`并包含 :ref:`multi: true <multi-"
384+
"parameter>` 选项来更新多个文档:"
340385

341386
#: ../source/tutorial/update-documents.txt:359
342387
msgid "Replace the Document"
343-
msgstr ""
388+
msgstr "文档替换"
344389

345390
#: ../source/tutorial/update-documents.txt:361
346391
msgid ""
@@ -350,6 +395,9 @@ msgid ""
350395
"replacing a document, the replacement document must consist of only "
351396
"``<field> : <value>``."
352397
msgstr ""
398+
"要更新除 ``_id`` 字段的文档的整个内容,传递一个全新的文档给:method:`db."
399+
"collection.replaceOne()` 给 :method:`db.collection.update()`作为第二个参数."
400+
"当替换文档时,替换文档必须仅仅由 ``<field> : <value>`` 组成."
353401

354402
#: ../source/tutorial/update-documents.txt:367
355403
msgid ""
@@ -358,24 +406,31 @@ msgid ""
358406
"the ``_id`` field is immutable; however, if you do include the ``_id`` "
359407
"field, it must have the same value as the current value."
360408
msgstr ""
409+
"替换文档可以有不同于原文档的字段.在替换文档中,由于 ``_id`` 字段是不变的,所"
410+
"以,你可以省略 ``_id`` 字段;不论如何,如果你包含了 ``_id`` 字段,它的值必须和当"
411+
"前的值相同."
361412

362413
#: ../source/tutorial/update-documents.txt:375
363414
msgid "``db.collection.replaceOne``"
364-
msgstr ""
415+
msgstr "``db.collection.replaceOne``"
365416

366417
#: ../source/tutorial/update-documents.txt:377
367418
msgid ""
368419
"The following example uses the :method:`db.collection.replaceOne()` method "
369420
"on the ``users`` collection to replace the *first* document that matches "
370421
"the filter ``name`` equals ``\"sue\"`` with the new document:"
371422
msgstr ""
423+
"下面的例子对 ``users`` 集合使用 :method:`db.collection.replaceOne()` 将匹配"
424+
"过滤条件--- ``name`` 等于 ``\"sue\"`` 的 *第一个* 文档替换为新文档:"
372425

373426
#: ../source/tutorial/update-documents.txt:391
374427
msgid ""
375428
"The following example uses the :method:`db.collection.update()` method on "
376429
"the ``users`` collection to replace the *first* document that matches the "
377430
"filter ``name`` equals ``\"xyz\"`` with the new document:"
378431
msgstr ""
432+
"下面的例子对 ``users`` 集合使用 :method:`db.collection.update()` 方法将匹配"
433+
"过滤条件--- ``name`` 等于 ``\"xyz\"`` 的 *第一个* 文档替换为新文档:"
379434

380435
#: ../source/tutorial/update-documents.txt:403
381436
msgid "Additional Methods"

0 commit comments

Comments
 (0)