Skip to content
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
17 changes: 12 additions & 5 deletions source/includes/fact-download-mongo-shell.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
The :binary:`~bin.mongo` shell is included as part of the :doc:`MongoDB Server
</installation>` installation. MongoDB also provides the :binary:`~bin.mongo`
shell as a standalone package. To download the standalone :binary:`~bin.mongo`
shell package:
The :binary:`~bin.mongo` shell is included as part of the :doc:`MongoDB
server installation </installation>`. If you have already installed the
server, the :binary:`~bin.mongo` shell is installed to the same location
as the server binary.

Alternatively, if you would like to download the :binary:`~bin.mongo`
shell separately from the MongoDB Server, you can install the shell as
a standalone package by following these steps:

1. Access the Download Center for your Edition of MongoDB:

Expand Down Expand Up @@ -38,5 +42,8 @@ shell package:

* - *Linux*

- Select the ``shell`` package to download the
- Select the ``tgz`` package to download the
:binary:`~bin.mongo` shell.

4. Copy the :binary:`~bin.mongo` shell from the archive to a location on
your filesystem.
40 changes: 24 additions & 16 deletions source/mongo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,45 @@ The :binary:`~bin.mongo` shell is an interactive JavaScript interface to
MongoDB. You can use the :binary:`~bin.mongo` shell to query and update
data as well as perform administrative operations.

Download the ``mongo`` Shell
----------------------------

.. include:: /includes/fact-download-mongo-shell.rst

Once you have :doc:`installed and have started MongoDB </installation>`, connect
the :binary:`~bin.mongo` shell to your running MongoDB instance.
Start the ``mongo`` Shell and Connect to MongoDB
------------------------------------------------

Once you have downloaded the :binary:`~bin.mongo` shell, you can use it
to connect to your running MongoDB server.

.. note::

.. include:: /includes/extracts/4.2-changes-mongoshell-emulation.rst

Start the ``mongo`` Shell and Connect to MongoDB
------------------------------------------------

Prerequisites
~~~~~~~~~~~~~

Ensure that MongoDB is running before attempting to start the
:binary:`~bin.mongo` shell.
- The MongoDB server must be installed and running before you can
connect to it from the :binary:`~bin.mongo` shell. Follow the steps in
the :doc:`installation tutorial for your platform </installation>`
to install and start the MongoDB server if required.

Open a terminal window (or a command prompt for Windows) and go to your
``<mongodb installation dir>/bin`` directory:
- Once you have verified that the :binary:`~bin.mongod` server is
running, open a terminal window (or a command prompt for Windows) and
go to your ``<mongo shell installation dir>`` directory:

.. code-block:: sh
.. code-block:: sh

cd <mongodb installation dir>/bin
cd <mongo shell installation dir>

.. tip::
.. tip::

Adding your ``<mongodb installation dir>/bin`` to the ``PATH``
environment variable allows you to type ``mongo`` instead of having
to go to the ``<mongodb installation dir>/bin`` directory or specify
the full path to the binary.
Adding your ``<mongo shell installation dir>`` to the ``PATH``
environment variable allows you to type ``mongo`` directly instead
of having to first go to the ``<mongo shell installation dir>``
directory or specify the full path to the binary. Alternatively, you
can copy the ``mongo`` shell to a location on your filesystem that
is already present in your ``PATH``, such as ``/usr/bin`` on Linux.

Local MongoDB Instance on Default Port
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down