Skip to content

Getting Started to use drivers tab set #3079

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
Nov 6, 2017
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
12 changes: 2 additions & 10 deletions source/includes/steps-getting-started.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ title: "Download the connecting client."
level: 3
ref: download-shell-driver
content: |
.. tabs-gs::
.. tabs-drivers::

tabs:
- id: shell
name: Mongo Shell
content: |
To download the :program:`mongo` Shell:

Expand All @@ -82,14 +81,12 @@ content: |
:ref:`Installation<tutorial-installation>`.

- id: compass
name: Compass
content: |
Download MongoDB Compass from the
`download center <https://www.mongodb.com/download-center?filter=enterprise#compass>`_
and install it.

- id: python
name: Python
content: |
Install the `PyMongo <https://api.mongodb.com/python/current/index.html>`_
driver via ``pip``:
Expand All @@ -102,7 +99,6 @@ content: |
For more information, see `Installing Pymongo <https://api.mongodb.com/python/current/installation.html>`_.

- id: nodejs
name: Node.js
content: |
First create your project using ``npm init`` then install the
:node-docs:`MongoDB Node.js Driver <>` via ``npm``:
Expand Down Expand Up @@ -137,11 +133,10 @@ ref: connect-cluster-shell
content: |
Using the **URI string** from the previous step, connect to the Atlas cluster:

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: shell
name: Mongo Shell
content: |

.. class:: copyable-code
Expand All @@ -165,7 +160,6 @@ content: |
"C:\Program Files\MongoDB\Server\3.6\bin\mongo.exe" "mongodb://user123:[email protected]:27017,gettingstarted-shard-00-01-hyjsm.mongodb.net:27017,gettingstarted-shard-00-02-hyjsm.mongodb.net:27017/test?ssl=true&replicaSet=GettingStarted-shard-0&authSource=admin"

- id: compass
name: Compass
content: |
1. Launch MongoDB Compass with the URI from the previous step copied to the clipboard.
2. A dialog box will prompt you to use the URI to fill out the connect form. Click :guilabel:`Yes`.
Expand All @@ -181,7 +175,6 @@ content: |
5. Click :guilabel:`Connect`.

- id: python
name: Python
content: |

.. class:: copyable-code
Expand All @@ -195,7 +188,6 @@ content: |
# Paste the following examples here

- id: nodejs
name: Node.js
content: |

.. class:: copyable-code
Expand Down
36 changes: 8 additions & 28 deletions source/tutorial/getting-started.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,30 @@ for provisioning, running, monitoring, and maintaining MongoDB deployments. It
is a fast, easy, and free way to get started with MongoDB. To install and run
MongoDB locally, see :ref:`Install MongoDB<tutorial-installation>`.

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: shell
name: Mongo Shell
content: |
The following tutorial uses
:program:`mongo` shell to connect to an Atlas free-tier cluster, insert
data, and perform query operations.

- id: compass
name: Compass
content: |
`MongoDB Compass <https://docs.mongodb.com/compass/current/>`_ is the
GUI for MongoDB. The following tutorial uses MongoDB Compass to connect
to an Atlas free-tier cluster, insert data, and perform query
operations.

- id: python
name: Python
content: |
The following tutorial uses the
`PyMongo <https://api.mongodb.com/python/current/index.html>`_ Python
driver to connect to an Atlas free-tier cluster, insert data, and
perform query operations.

- id: nodejs
name: Node.js
content: |
The following tutorial uses the :node-docs:`MongoDB Node.js Driver <>`
to connect to an Atlas free-tier cluster, then perform insert and query
Expand All @@ -62,11 +58,10 @@ MongoDB databases hold collections of documents.
Insert Documents
----------------

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: shell
name: Mongo Shell
content: |
:method:`db.collection.insertMany()` can insert *multiple*
:ref:`documents <bson-document-format>` into a collection. Pass an
Expand Down Expand Up @@ -99,7 +94,6 @@ Insert Documents
Use :method:`db.collection.insertOne()` to insert a single document.

- id: compass
name: Compass
content: |
1. Click :guilabel:`Create Database`.

Expand Down Expand Up @@ -159,7 +153,6 @@ Insert Documents
size: { h: 10, w: 15.25, uom: "cm" }, tags: [ "blue" ] }

- id: python
name: Python
content: |
:py:meth:`pymongo.collection.Collection.insert_many` can insert
*multiple* :ref:`documents <bson-document-format>` into a collection.
Expand Down Expand Up @@ -193,7 +186,6 @@ Insert Documents
single document.

- id: nodejs
name: Node.js
content: |
:node-api:`Collection.insertMany() <Collection.html#insertMany>` can
insert *multiple* :ref:`documents <bson-document-format>` into a
Expand Down Expand Up @@ -238,18 +230,16 @@ Query Documents
Select All Documents
~~~~~~~~~~~~~~~~~~~~

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: shell
name: Mongo Shell
content: |
To select all documents in the collection, pass an empty document as the
:ref:`query filter document <document-query-filter>` to the
:method:`db.collection.find()` method:

- id: compass
name: Compass
content: |
Select the ``inventory`` collection from the :guilabel:`Collections`
tab or the left-hand pane. By default, all documents are selected and
Expand All @@ -262,26 +252,23 @@ Select All Documents
.. include:: /images/compass-find-all.rst

- id: python
name: Python
content: |
To select all documents in the collection, pass an empty document as the
:ref:`query filter document <document-query-filter>` to the
:py:meth:`pymongo.collection.Collection.find` method:

- id: nodejs
name: Node.js
content: |
To select all documents in the collection, pass an empty document as the
:ref:`query filter document <document-query-filter>` to the
:node-api:`Collection.find() <Collection.html#find>` method:

.. include:: /includes/driver-example-query-7.rst

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: shell
name: Mongo Shell
content: |
To query for documents that match specific equality conditions, pass the
:method:`~db.collection.find()` method a :ref:`query filter document <document-query-filter>`
Expand All @@ -290,7 +277,6 @@ Select All Documents
equals ``"D"``:

- id: compass
name: Compass
content: |
To query for documents that match specific equality conditions, pass
a :ref:`query filter document <document-query-filter>` to the
Expand All @@ -306,7 +292,6 @@ Select All Documents
.. include:: /images/compass-find-filter.rst

- id: python
name: Python
content: |
To query for documents that match specific equality conditions, pass the
:py:meth:`~pymongo.collection.Collection.find` method a
Expand All @@ -316,7 +301,6 @@ Select All Documents
``status`` equals ``"D"``:

- id: nodejs
name: Node.js
content: |
To query for documents that match specific equality conditions, pass the
:node-api:`find() <Collection.html#find>` method a
Expand All @@ -336,11 +320,10 @@ equals the document ``{ h: 14, w: 21, uom: "cm" }``:

.. include:: /includes/driver-example-query-15.rst

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: compass
name: Compass
content: |
.. class:: copyable-code
.. code-block:: javascript
Expand All @@ -357,11 +340,10 @@ nested in the ``size`` field equals the string value ``"in"``:

.. include:: /includes/driver-example-query-17.rst

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: compass
name: Compass
content: |
.. class:: copyable-code
.. code-block:: javascript
Expand All @@ -378,11 +360,10 @@ array that contains the string ``"red"`` as one of its elements:

.. include:: /includes/driver-example-query-23.rst

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: compass
name: Compass
content: |
.. class:: copyable-code
.. code-block:: javascript
Expand All @@ -400,11 +381,10 @@ in the specified order:

.. include:: /includes/driver-example-query-21.rst

.. tabs-gs::
.. tabs-drivers::

tabs:
- id: compass
name: Compass
content: |
.. class:: copyable-code
.. code-block:: javascript
Expand Down