Skip to content

DOCS-959 minor copy edits #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/faq/mongo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <mongo-dbshell-file>` documentation for more
information on the ``.dbshell.js`` file.
:ref:`.dbshell <mongo-dbshell-file>` documentation for more
information on the ``.dbshell`` file.

- Use ``<Tab>`` to autocomplete or to list the completion
possibilities, as in the following example which uses ``<Tab>`` to
Expand Down
22 changes: 10 additions & 12 deletions source/tutorial/getting-started-with-the-mongo-shell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------------
Expand Down Expand Up @@ -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
<mongo-mongorc-file>`. 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 <mongo-shell-file>`,
: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
<mongo-shell-file>`, :program:`mongo` will read the ``.mongorc.js``
file *after* the JavaScript has finished processing.

.. _mongo-shell-executing-queries:

Expand All @@ -80,7 +78,7 @@ From the :program:`mongo` shell, you can use the :doc:`shell methods

db.<collection>.find()

- The ``db`` is a variable that refers to the current database.
- The ``db`` refers to the current database.

- The ``<collection>`` is the name of the collection to query. See
:ref:`mongo-shell-help-collection` to list the available collections.
Expand All @@ -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``:

Expand Down
16 changes: 8 additions & 8 deletions source/tutorial/write-scripts-for-the-mongo-shell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we document connect() separately?

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``:
Expand All @@ -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
<mongo-shell-javascript-file>`, you must specify the ``db`` variable in
the specified methods. You **cannot** use ``use <dbname>`` 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</core/write-operations>`.
<mongo-shell-javascript-file>`, you must assign the ``db`` variable
using the ``getDB()`` method or the ``connect()`` method. You
**cannot** use ``use <dbname>`` 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</core/write-operations>`.

.. _mongo-shell-scripting:

Expand Down