From 67d90020e15b490bfca506c20134a286586247a3 Mon Sep 17 00:00:00 2001 From: jeff-allen-mongo Date: Thu, 9 Jul 2020 13:56:43 -0400 Subject: [PATCH] (DOCSP-11133): Add callout to mongosh --- conf.py | 4 ++- source/core/shell-types.txt | 2 ++ source/includes/fact-mongosh-callout.rst | 11 +++++++ source/mongo.txt | 33 +++++++++++++++++++ source/reference/mongo-shell.txt | 2 ++ source/tutorial/access-mongo-shell-help.txt | 3 +- source/tutorial/configure-mongo-shell.txt | 2 ++ .../write-scripts-for-the-mongo-shell.txt | 2 ++ 8 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 source/includes/fact-mongosh-callout.rst diff --git a/conf.py b/conf.py index e1d88aa4ccb..bbd85c0e9e6 100644 --- a/conf.py +++ b/conf.py @@ -71,7 +71,8 @@ def has(self, *args): '.. |branch| replace:: ``{0}``'.format(conf.git.branches.current), '.. |bi| replace:: MongoDB Connector for BI', '.. |version| replace:: {0}'.format(version), - '.. |compass| replace:: MongoDB Compass' + '.. |compass| replace:: MongoDB Compass', + '.. |mdb-shell| replace:: MongoDB Shell' ]) source_constants = { @@ -101,6 +102,7 @@ def has(self, *args): 'mms-home': ('https://www.mongodb.com/cloud/cloud-manager%s', ''), 'opsmgr': ('https://docs.opsmanager.mongodb.com/current%s', ''), 'atlas': ('https://docs.atlas.mongodb.com%s',''), + 'mongosh': ('https://docs.mongodb.com/mongodb-shell%s', ''), 'products': ('https://www.mongodb.com/products%s', ''), 'wtdocs': ('https://source.wiredtiger.com/mongodb-3.4%s', ''), 'perl-api': ('https://metacpan.org/pod/MongoDB::%s', ''), diff --git a/source/core/shell-types.txt b/source/core/shell-types.txt index a9733fba16a..782550c51b1 100644 --- a/source/core/shell-types.txt +++ b/source/core/shell-types.txt @@ -10,6 +10,8 @@ Data Types in the ``mongo`` Shell :depth: 2 :class: singlecol +.. include:: /includes/fact-mongosh-callout.rst + MongoDB :term:`BSON` provides support for additional data types than :term:`JSON`. :ecosystem:`Drivers ` provide native support for these data types in host languages and the diff --git a/source/includes/fact-mongosh-callout.rst b/source/includes/fact-mongosh-callout.rst new file mode 100644 index 00000000000..5c21dbfee81 --- /dev/null +++ b/source/includes/fact-mongosh-callout.rst @@ -0,0 +1,11 @@ +.. note:: + + The following document pertains to the :binary:`~bin.mongo` shell + included in the + `MongoDB Server Download + `__. + For information on the new MongoDB Shell, ``mongosh``, refer to the + :mongosh:`mongosh Documentation `. + + To understand the differences between the two shells, see + :ref:`compare-mongosh-mongo`. diff --git a/source/mongo.txt b/source/mongo.txt index 36c605caa1c..c050e98483b 100644 --- a/source/mongo.txt +++ b/source/mongo.txt @@ -14,6 +14,8 @@ 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. +.. include:: /includes/fact-mongosh-callout.rst + Download the ``mongo`` Shell ---------------------------- @@ -395,10 +397,41 @@ Exit the Shell To exit the shell, type ``quit()`` or use the ```` shortcut. +.. _compare-mongosh-mongo: + +Comparison of the ``mongo`` Shell and ``mongosh`` +------------------------------------------------- + +.. note:: + + :mongosh:`mongosh ` is currently available as a + **Beta** release. The product, its features, and the corresponding + documentation may change during the Beta stage. + +The new MongoDB Shell, :mongosh:`mongosh `, offers numerous +advantages over the :binary:`~bin.mongo` shell, such as: + +- Improved syntax highlighting. + +- Improved command history. + +- Improved logging. + +During the beta stage, ``mongosh`` supports a subset of the +:binary:`~bin.mongo` shell methods. Achieving feature parity between +``mongosh`` and the ``mongo`` shell is an ongoing effort. + +To maintain backwards compatibility, the methods that ``mongosh`` +supports use the same syntax as the corresponding methods in the +:binary:`~bin.mongo` shell. To see the complete list of methods +supported by ``mongosh``, see +:mongosh:`MongoDB Shell Methods `. + .. seealso:: - :gettingstarted:`Getting Started Guide ` - :binary:`~bin.mongo` Reference Page + - :mongosh:`mongosh Documentation ` .. class:: hidden diff --git a/source/reference/mongo-shell.txt b/source/reference/mongo-shell.txt index 39e3e0d77bf..eb269e68311 100644 --- a/source/reference/mongo-shell.txt +++ b/source/reference/mongo-shell.txt @@ -10,6 +10,8 @@ :depth: 1 :class: singlecol +.. include:: /includes/fact-mongosh-callout.rst + ``mongo`` Shell Command History ------------------------------- diff --git a/source/tutorial/access-mongo-shell-help.txt b/source/tutorial/access-mongo-shell-help.txt index 9c5d86d40cf..0a06db77a54 100644 --- a/source/tutorial/access-mongo-shell-help.txt +++ b/source/tutorial/access-mongo-shell-help.txt @@ -12,6 +12,8 @@ Access the ``mongo`` Shell Help :depth: 1 :class: twocols +.. include:: /includes/fact-mongosh-callout.rst + In addition to the documentation in the :doc:`MongoDB Manual `, the :binary:`~bin.mongo` shell provides some additional information in its "online" help system. This document provides an @@ -174,4 +176,3 @@ shell, such as ``BinData()``, type ``help misc`` in the help misc .. seealso:: :doc:`/reference/method` - diff --git a/source/tutorial/configure-mongo-shell.txt b/source/tutorial/configure-mongo-shell.txt index 011af8b5e91..17a5552c036 100644 --- a/source/tutorial/configure-mongo-shell.txt +++ b/source/tutorial/configure-mongo-shell.txt @@ -10,6 +10,8 @@ Configure the ``mongo`` Shell :depth: 1 :class: singlecol +.. include:: /includes/fact-mongosh-callout.rst + .. _shell-use-a-custom-prompt: Customize the Prompt diff --git a/source/tutorial/write-scripts-for-the-mongo-shell.txt b/source/tutorial/write-scripts-for-the-mongo-shell.txt index 60da263fd0e..ff086b783db 100644 --- a/source/tutorial/write-scripts-for-the-mongo-shell.txt +++ b/source/tutorial/write-scripts-for-the-mongo-shell.txt @@ -10,6 +10,8 @@ Write Scripts for the ``mongo`` Shell :depth: 1 :class: singlecol +.. include:: /includes/fact-mongosh-callout.rst + You can write scripts for the :binary:`~bin.mongo` shell in JavaScript that manipulate data in MongoDB or perform administrative operation.