diff --git a/source/faq/mongo.txt b/source/faq/mongo.txt index 6ecaf55fe00..b946fb46ccc 100644 --- a/source/faq/mongo.txt +++ b/source/faq/mongo.txt @@ -14,7 +14,7 @@ How can I enter multi-line operations in the ``mongo`` shell? ------------------------------------------------------------- If you end a line with an open parenthesis (``'('``), an open brace -(``'{'``), or an open bracket (``'['``), then the following lines start +(``'{'``), or an open bracket (``'['``), then the subsequent lines start with ellipsis (``"..."``) until the you enter the corresponding closing parenthesis (``')'``), the closing brace (``'}'``) or the closing bracket (``']'``). The :program:`mongo` shell waits for the closing @@ -62,8 +62,8 @@ Does the ``mongo`` shell support tab completion and other keyboard shortcuts? The :program:`mongo` shell supports keyboard shortcuts. For example, - Use the up/down arrow keys to scroll through command history. See - :ref:`.dbshell.js ` documentation for more - information on the ``.dbshell.js`` file. + :ref:`.dbshell ` documentation for more + information on the ``.dbshell`` file. - Use ```` to autocomplete or to list the completion possibilities, as in the following example which uses ```` to diff --git a/source/tutorial/getting-started-with-the-mongo-shell.txt b/source/tutorial/getting-started-with-the-mongo-shell.txt index 0584bf2247b..1c3c1e82284 100644 --- a/source/tutorial/getting-started-with-the-mongo-shell.txt +++ b/source/tutorial/getting-started-with-the-mongo-shell.txt @@ -5,10 +5,8 @@ Getting Started with the ``mongo`` Shell .. default-domain:: mongodb This document provides a basic introduction to using the -:program:`mongo` shell. See :doc:`/tutorial/getting-started` for an -introduction to basic MongoDB operations and use. See -:doc:`/installation` for instructions on installing MongoDB for your -system. +:program:`mongo` shell. See :doc:`/installation` for instructions on +installing MongoDB for your system. Start the ``mongo`` Shell ------------------------- @@ -61,12 +59,12 @@ available options. When starting, :program:`mongo` checks the user's :envvar:`HOME` directory for a JavaScript file named :ref:`.mongorc.js `. If found, :program:`mongo` interprets the - content :file:`.mongorc.js` before displaying the prompt for - the first time. If you use the shell to evaluate a JavaScript file - or expression either on the command line with :option:`--eval` or - by specifying :ref:`a .js file to mongo `, - :program:`mongo` will read the ``.mongorc.js`` file *after* the - JavaScript has finished processing. + content of :file:`.mongorc.js` before displaying the prompt for the + first time. If you use the shell to evaluate a JavaScript file or + expression, either by using the :option:`--eval` option on the + command line or by specifying :ref:`a .js file to mongo + `, :program:`mongo` will read the ``.mongorc.js`` + file *after* the JavaScript has finished processing. .. _mongo-shell-executing-queries: @@ -80,7 +78,7 @@ From the :program:`mongo` shell, you can use the :doc:`shell methods db..find() -- The ``db`` is a variable that refers to the current database. +- The ``db`` refers to the current database. - The ```` is the name of the collection to query. See :ref:`mongo-shell-help-collection` to list the available collections. @@ -105,7 +103,7 @@ From the :program:`mongo` shell, you can use the :doc:`shell methods first 20 documents that match the query. The :program:`mongo` shell will prompt ``Type it`` to iterate another 20 times. - You can set the ``DBQuery.shellBatchSize`` variable to change the + You can set the ``DBQuery.shellBatchSize`` attribute to change the number of iteration from the default value ``20``, as in the following example which sets it to ``10``: diff --git a/source/tutorial/write-scripts-for-the-mongo-shell.txt b/source/tutorial/write-scripts-for-the-mongo-shell.txt index c68171d7509..6611f6e7625 100644 --- a/source/tutorial/write-scripts-for-the-mongo-shell.txt +++ b/source/tutorial/write-scripts-for-the-mongo-shell.txt @@ -30,14 +30,14 @@ instantiate database connections using the ``Mongo()`` constructor: Consider the following example that instantiates a new connection to the MongoDB instance running on localhost on the default port and sets -the current ``db`` to ``myDatabase``: +the current ``db`` to ``myDatabase`` using the ``getDB()`` method: .. code-block:: javascript conn = new Mongo(); db = conn.getDB("myDatabase"); -Additionally, you can use the ``connect`` method to connect to the +Additionally, you can use the ``connect()`` method to connect to the MongoDB instance. The following example connects to the MongoDB instance that is running on ``localhost`` with the non-default port ``207020`` and set the current ``db``: @@ -47,12 +47,12 @@ instance that is running on ``localhost`` with the non-default port db = connect("localhost:27020/myDatabase"); If you create new connections inside a :ref:`JavaScript file -`, you must specify the ``db`` variable in -the specified methods. You **cannot** use ``use `` inside the -file. Additionally, inside the script, you would need to call -:method:`db.getLastErrorObj()` or :method:`db.getLastError()` -explicitly to wait for the result of :doc:`write -operations`. +`, you must assign the ``db`` variable +using the ``getDB()`` method or the ``connect()`` method. You +**cannot** use ``use `` inside the file. Additionally, inside +the script, you would need to call :method:`db.getLastErrorObj()` or +:method:`db.getLastError()` explicitly to wait for the result of +:doc:`write operations`. .. _mongo-shell-scripting: