@@ -13,65 +13,72 @@ msgstr ""
1313
1414#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:3
1515msgid "Getting Started with the ``mongo`` Shell"
16- msgstr ""
16+ msgstr " ``mongo`` 命令行入门 "
1717
1818#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:7
1919msgid ""
2020"This document provides a basic introduction to using the :program:`mongo` "
2121"shell. See :doc:`/installation` for instructions on installing MongoDB for "
2222"your system."
23- msgstr ""
23+ msgstr "本文提供一个基本的介绍使用 :program:`mongo` 命令行."
24+ "参见 :doc:`/installation` 为您的系统安装MongoDB"
2425
2526#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:12
2627msgid "Start the ``mongo`` Shell"
27- msgstr ""
28+ msgstr "启动 ``mongo`` 命令行 "
2829
2930#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:14
3031msgid ""
3132"To start the :program:`mongo` shell and connect to your :doc:`MongoDB "
3233"</reference/program/mongod>` instance running on **localhost** with "
3334"**default port**:"
34- msgstr ""
35+ msgstr "启动 :program:`mongo` 命令行连接到 **本地主机** **默认端口** "
36+ "运行您的MongoDB "
3537
3638#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:17
3739msgid "Go to your ``<mongodb installation dir>``:"
38- msgstr ""
40+ msgstr "到您的 ``<MongoDB安装目录>``: "
3941
4042#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:23
4143msgid "Type ``./bin/mongo`` to start :program:`mongo`:"
42- msgstr ""
44+ msgstr "输入 ``./bin/mongo`` 运行 :program:`mongo`: "
4345
4446#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:29
4547msgid ""
4648"If you have added the ``<mongodb installation dir>/bin`` to the ``PATH`` "
4749"environment variable, you can just type ``mongo`` instead of "
4850"``./bin/mongo``."
49- msgstr ""
51+ msgstr "如果你已经添加 ``<MongoDB安装目录>/bin`` 添加到PATH环境变量中."
52+ "你只要输入 ``mongo`` 代替 ``./bin/mongo``."
5053
5154#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:33
5255msgid "To display the database you are using, type ``db``:"
53- msgstr ""
56+ msgstr "显示您正在使用的数据库,输入 ``db``: "
5457
5558#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:39
5659msgid ""
5760"The operation should return ``test``, which is the default database. To "
5861"switch databases, issue the ``use <db>`` helper, as in the following "
5962"example:"
60- msgstr ""
63+ msgstr "该操作返回 ``test``, 这是默认的数据库.要切换数据库,"
64+ "输入 ``use <db>`` .如下面的例子:"
6165
6266#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:47
6367msgid ""
6468"To list the available databases, use the helper ``show dbs``. See also :ref"
6569":`mongo-shell-getSiblingDB` to access a different database from the current "
6670"database without switching your current database context (i.e. ``db.``.)"
67- msgstr ""
71+ msgstr "要列出可用的数据库.使用 ``show dbs``.参见 :ref"
72+ ":`mongo-shell-getSiblingDB` 从当前数据库访问不同的数据库,"
73+ "而无需切换当前的数据库环境(即db)."
6874
6975#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:52
7076msgid ""
7177"To start the :program:`mongo` shell with other options, see :ref:`examples "
7278"of starting up mongo <mongo-usage-examples>` and :doc:`mongo reference "
7379"</reference/program/mongo>` which provides details on the available options."
74- msgstr ""
80+ msgstr "启动 :program:`mongo` 命令行的其它选项,请参见 :ref:`examples"
81+ " of starting up mongo <mongo-usage-examples>` 它提供可用选项的详细信息."
7582
7683#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:59
7784msgid ""
@@ -85,34 +92,48 @@ msgid ""
8592"file *after* the JavaScript has finished processing. You can prevent "
8693"``.mongorc.js`` from being loaded by using the :option:`--norc` option."
8794msgstr ""
95+ "在启动时, :program:`mongo` 检查用户 :envvar:`HOME` 目录名为"
96+ ":ref:`.mongorc.js <mongo-mongorc-file>`的JavaScript文件. 如果发现,"
97+ ":program:`mongo` 显示的提示是首次解释 :file:`.mongorc.js` 的内容."
98+ "如果你使用命令行来评估一个JavaScript 文件或表达式,或者通过使用命令行选项"
99+ ":option:`--eval <mongo --eval>` 或指定的 :ref:`a .js file to"
100+ "mongo <mongo-shell-file>`,*之后*,:program:`mongo` 将读取JavaScript处理完成的"
101+ " ``.mongorc.js`` 文件.你可以使用选项 :option:`--norc` 来防止"
102+ " ``.mongorc.js`` 被加载."
103+
88104
89105#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:73
90106msgid "Executing Queries"
91- msgstr ""
107+ msgstr "执行查询 "
92108
93109#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:75
94110msgid ""
95111"From the :program:`mongo` shell, you can use the :doc:`shell methods "
96112"</reference/method>` to run queries, as in the following example:"
97- msgstr ""
113+ msgstr "从 :program:`mongo` 命令行,你可以使用 :doc:`shell methods "
114+ "</reference/method>`来运行查询.如下面的例子:"
98115
99116#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:82
100117msgid "The ``db`` refers to the current database."
101- msgstr ""
118+ msgstr "该 ``db`` 是指当前的数据库. "
102119
103120#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:84
104121msgid ""
105122"The ``<collection>`` is the name of the collection to query. See :ref"
106123":`mongo-shell-help-collection` to list the available collections."
107- msgstr ""
124+ msgstr "该 ``<collection>`` 是查询的集合名称. 参见"
125+ " :ref:`mongo-shell-help-collection` 列出可用的集合."
108126
109127#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:87
110128msgid ""
111129"If the :program:`mongo` shell does not accept the name of the collection, "
112130"for instance if the name contains a space, hyphen, or starts with a number, "
113131"you can use an alternate syntax to refer to the collection, as in the "
114132"following:"
115- msgstr ""
133+ msgstr "如果该 :program:`mongo` 命令行不接受的集合名称.例如:集合名称中包含"
134+ " **空格**,**连字符(-)**,或以 **数字** 开头,你可以使用替代语法来引用集合."
135+ "如下面的例子:"
136+
116137
117138#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:98
118139msgid ""
@@ -124,32 +145,40 @@ msgid ""
124145"automatically iterated up to 20 times to print up to the first 20 documents "
125146"that match the query. The :program:`mongo` shell will prompt ``Type it`` to "
126147"iterate another 20 times."
127- msgstr ""
148+ msgstr "该 :method:`~db.collection.find()` 方法是JavaScript检索"
149+ " ``<collection>`` 的方法. :method:`~db.collection.find()` 返回一个游标的结果."
150+ "然而,在 :program:`mongo` 命令行,如果返回的游标没有分配给使用var关键字的变量."
151+ "则游标被最多自动迭代20次,最多输出与查询匹配的头20个文档."
152+ "该 :program:`mongo` 命令行提示 ``Type it`` 迭代出其它20个文档."
128153
129154#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:108
130155msgid ""
131156"You can set the ``DBQuery.shellBatchSize`` attribute to change the number of"
132157" iteration from the default value ``20``, as in the following example which "
133158"sets it to ``10``:"
134- msgstr ""
159+ msgstr "你可以设置 ``DBQuery.shellBatchSize`` 属性改变迭代默认值 ``20``,"
160+ "在下面的例子中设置它为 ``10``:"
135161
136162#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:116
137163msgid ""
138164"For more information and examples on cursor handling in the :program:`mongo`"
139165" shell, see :doc:`/core/cursors`."
140- msgstr ""
166+ msgstr "更多游标在:program:`mongo` 命令行的信息和处理的例子,"
167+ "参见 :doc:`/core/cursors`."
141168
142169#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:119
143170msgid ""
144171"See also :ref:`mongo-shell-help-cursor` for list of cursor help in the "
145172":program:`mongo` shell."
146- msgstr ""
173+ msgstr "参见 :ref:`mongo-shell-help-cursor` 游标在"
174+ " :program:`mongo` 命令行的帮助列表."
175+
147176
148177#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:122
149178msgid ""
150179"For more documentation of basic MongoDB operations in the :program:`mongo` "
151180"shell, see:"
152- msgstr ""
181+ msgstr "更多在 :program:`mongo` 命令行的基本MongoDB操作,参见: "
153182
154183#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:125
155184msgid ":doc:`/tutorial/getting-started`"
@@ -173,51 +202,56 @@ msgstr ""
173202
174203#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:134
175204msgid "Print"
176- msgstr ""
205+ msgstr "输出 "
177206
178207#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:136
179208msgid ""
180209"The :program:`mongo` shell automatically prints the results of the "
181210":method:`~db.collection.find()` method if the returned cursor is not "
182211"assigned to a variable using the ``var`` keyword. To format the result, you "
183212"can add the ``.pretty()`` to the operation, as in the following:"
184- msgstr ""
213+ msgstr " :program:`mongo` 命令行自动输出 :method:`~db.collection.find()`"
214+ "方法的结果.如果返回的游标没有分配给使用var关键字的变量.你可以添加"
215+ " ``.pretty()`` 的操作,如下面的例子:"
185216
186217#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:146
187218msgid ""
188219"In addition, you can use the following explicit print methods in the "
189220":program:`mongo` shell:"
190- msgstr ""
221+ msgstr "另外,你可以在 :program:`mongo` 命令行下准确的输出该方法: "
191222
192223#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:149
193224msgid "``print()`` to print without formatting"
194- msgstr ""
225+ msgstr "``print()`` 不格式化输出 "
195226
196227#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:151
197228msgid ""
198229"``print(tojson(<obj>))`` to print with :term:`JSON` formatting and "
199230"equivalent to ``printjson()``"
200- msgstr ""
231+ msgstr "``print(tojson(<obj>))`` 输出格式化的 :term:`JSON` 与"
232+ "``printjson()`` 相当"
201233
202234#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:154
203235msgid ""
204236"``printjson()`` to print with :term:`JSON` formatting and equivalent to "
205237"``print(tojson(<obj>))``"
206- msgstr ""
238+ msgstr "``printjson()`` 输出格式化的 :term:`JSON` 与"
239+ "``print(tojson(<obj>))`` 相当"
207240
208241#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:158
209242msgid "Evaluate a JavaScript File"
210- msgstr ""
243+ msgstr "评估一个JavaScript文件 "
211244
212245#: ../source/includes/fact-execute-javascript-from-shell.rst:1
213246msgid ""
214247"You can execute a ``.js`` file from within the :program:`mongo` shell, using"
215248" the :method:`load()` function, as in the following:"
216- msgstr ""
249+ msgstr "你可以在 :program:`mongo` 命令行下执行一个 ``.js`` 文件."
250+ "使用 :method:`load()` 函数,如下面的例子:"
217251
218252#: ../source/includes/fact-execute-javascript-from-shell.rst:8
219253msgid "This function loads and executes the :file:`myjstest.js` file."
220- msgstr ""
254+ msgstr "这个函数加载和执行 :file:`myjstest.js` 文件 "
221255
222256#: ../source/includes/fact-execute-javascript-from-shell.rst:10
223257msgid ""
@@ -226,18 +260,21 @@ msgid ""
226260" and the :file:`myjstest.js` resides in the :file:`/data/db/scripts` "
227261"directory, then the following calls within the :program:`mongo` shell would "
228262"be equivalent:"
229- msgstr ""
263+ msgstr " :method:`load()` 方法接受相对和绝对路径.如果 :program:`mongo` 命令行"
264+ "当前的工作目录是 :file:`/data/db`,而 :file:`myjstest.js` 驻留在"
265+ " :file:`/data/db/scripts` 目录,那么 :program:`mongo` 命令行在下面的调用是相等的:"
230266
231267#: ../source/includes/fact-execute-javascript-from-shell.rst:21
232268msgid ""
233269"There is no search path for the :method:`load()` function. If the desired "
234270"script is not in the current working directory or the full specified path, "
235271":program:`mongo` will not be able to access the file."
236- msgstr ""
272+ msgstr "没有为 :method:`load()` 提供搜索路径的功能."
273+ "如果所需的 script 不是在当前工作目录下或完整指定的路径,mongo将不能访问该文件"
237274
238275#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:163
239276msgid "Use a Custom Prompt"
240- msgstr ""
277+ msgstr "使用自定义提示 "
241278
242279#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:165
243280msgid ""
@@ -246,59 +283,64 @@ msgid ""
246283" JavaScript. If ``prompt`` holds a function that returns a string, "
247284":program:`mongo` can display dynamic information in each prompt. Consider "
248285"the following examples:"
249- msgstr ""
286+ msgstr "你可以在shell下创建变量修改提示的内容.``prompt``变量可以保存字符串"
287+ "以及任意JavaScript.如果``prompt``保存函数返回一个字符串,:program:`mongo` "
288+ "可以显示每个动态的``prompt``信息.请看下面例子:"
250289
251290#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:0
252291#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:0
253292#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:0
254293msgid "Example"
255- msgstr ""
294+ msgstr "例子 "
256295
257296#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:173
258297msgid ""
259298"Create a prompt with the number of operations issued in the current session,"
260299" define the following variables:"
261- msgstr ""
300+ msgstr "创建与当前会话发出操作的数量提示,定义如下变量: "
262301
263302#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:183
264303#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:204
265304#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:224
266305msgid "The prompt would then resemble the following:"
267- msgstr ""
306+ msgstr "该提示将类似于以下内容: "
268307
269308#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:193
270309msgid ""
271310"To create a :program:`mongo` shell prompt in the form of "
272311"``<database>@<hostname>$`` define the following variables:"
273- msgstr ""
312+ msgstr "在``<database>@<hostname>$`` 定义以下变量的形式创建一个"
313+ ":program:`mongo` 命令行提示符:"
274314
275315#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:214
276316msgid ""
277317"To create a :program:`mongo` shell prompt that contains the system up time "
278318"*and* the number of documents in the current database, define the following "
279319"prompt variable:"
280- msgstr ""
320+ msgstr "要创建一个 :program:`mongo` 命令行提示符包含系统时间和文件"
321+ "在当前数据库的数量,定义如下提示变量:"
281322
282323#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:232
283324msgid "Use an External Editor in the ``mongo`` Shell"
284- msgstr ""
325+ msgstr "在 ``mongo`` 命令行使用外部编辑器 "
285326
286327#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:236
287328msgid ""
288329"In the :program:`mongo` shell you can use the ``edit`` operation to edit a "
289330"function or variable in an external editor. The ``edit`` operation uses the "
290331"value of your environments ``EDITOR`` variable."
291- msgstr ""
332+ msgstr "在 :program:`mongo` 命令行可以使用 ``edit`` 操作在外部编辑器编辑"
333+ "一个功能或变量.编辑操作使用您的EDITOR环境变量的值."
292334
293335#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:240
294336msgid ""
295337"At your system prompt you can define the ``EDITOR`` variable and start "
296338":program:`mongo` with the following two operations:"
297- msgstr ""
339+ msgstr "在您的系统提示下你可以定义EDITOR变量,并开始:program:`mongo` 以下两个操作: "
298340
299341#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:248
300342msgid "Then, consider the following example shell session:"
301- msgstr ""
343+ msgstr "然后,考虑命令行会话下面的例子: "
302344
303345#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:270
304346msgid ""
@@ -307,12 +349,15 @@ msgid ""
307349":program:`mongo` may convert ``1+1`` to ``2`` or remove comments. The actual"
308350" changes affect only the appearance of the code and will vary based on the "
309351"version of JavaScript used but will not affect the semantics of the code."
310- msgstr ""
352+ msgstr "作为外部编辑器在mongo 命令行解释编辑代码时,它可以在功能上修改代码,"
353+ "这取决于JavaScript编译.对于mongo可以转换1+1到2或者删除注释."
354+ "实际变化影响的代码只是外观,并会基于JavaScript使用的版本不同而异."
355+ "但不会影响该代码的语义."
311356
312357#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:280
313358msgid "Exit the Shell"
314- msgstr ""
359+ msgstr "退出命令行 "
315360
316361#: ../source/tutorial/getting-started-with-the-mongo-shell.txt:282
317362msgid "To exit the shell, type ``quit()`` or use the ``<Ctrl-c>`` shortcut."
318- msgstr ""
363+ msgstr "要退出命令行,键入 ``quit()`` 或者 使用 ``<Ctrl-c>`` 快捷方式. "
0 commit comments