Skip to content
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

DOCSP-45921-export-query-prep #703

Merged
merged 5 commits into from
Dec 11, 2024
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
2 changes: 1 addition & 1 deletion source/collections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Tabbed View
You can open multiple Collection Detail screens in separate tabs. To
open a new tab to view collection details:

.. include:: /includes/steps/open-new-tab.rst
.. include:: /includes/shared/steps/open-new-tab.rst

.. BEGIN-COMPASS-ONLY

Expand Down
87 changes: 48 additions & 39 deletions source/export-query-to-language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,56 @@ and use |compass| queries in your application.
Procedure
---------

1. After constructing a query in the
:ref:`query bar <compass-query-bar>`, click :icon-mms:`ellipsis` to
the right of the :guilabel:`Reset` button.

#. Click the :guilabel:`Export to Language` button ``</>``:

.. figure:: /images/querybar/export-query-to-language-menu-option.png
:figwidth: 696px
:alt: Query bar export dropdown menu

#. In the :guilabel:`Export Query To:` dropdown, select your desired
language:

.. figure:: /images/querybar/export-query-to-language-select.png
:figwidth: 600px
:alt: Query bar language select

The :guilabel:`My Query` pane on the left displays your query in
:binary:`~mongosh` syntax.

The pane to the right displays your query in the language selected.

#. *(Optional)*: Check the :guilabel:`Include Import Statements` option
to include the required import statements for the language selected.

#. *(Optional)*: Check the :guilabel:`Include Driver Syntax` option
to include application code for the language selected. If you
include driver syntax, the copyable code reflects
:ref:`project <compass-query-bar-project>`, :ref:`sort <compass-query-bar-sort>`,
:ref:`maxtimems <compass-query-bar-max-time-ms>`,
:ref:`collation <compass-query-bar-collation>`, :ref:`skip <compass-query-bar-skip>`
and :ref:`limit <compass-query-bar-limit>` options.

#. Click :icon-fa5:`copy` at the top-right of the formatted
query to copy the query for the selected language to your clipboard.
You can now easily integrate and execute your created query in
your application.
.. procedure::
:style: normal

.. step:: Click the Export to Language button

In the query bar, click the ``</>`` icon to open the query export card.

.. figure:: /images/querybar/export-query-to-language-menu-option.png
:figwidth: 696px
:alt: Query bar export dropdown menu

.. step:: Select your export language

On the right side of the card, click the drop-down menu under
:guilabel:`Exported Query` and select your desired programming language.

The :guilabel:`My Query` pane on the left of the export card displays your
pipeline in :binary:`~mongosh` syntax. The :guilabel:`Exported Query` pane
to the right displays your pipeline in the selected programming language.

.. figure:: /images/querybar/export-query-to-language-select.png
:figwidth: 600px
:alt: Query bar language select

.. step:: *(Optional)* Include import statements

Click the :guilabel:`Include Import Statements` checkbox to include the
required import statements for the selected programming language.

.. step:: *(Optional)* Include driver syntax

Click the :guilabel:`Include Driver Syntax` checkbox to include
application code for the selected programming language. If you include
driver syntax, the copyable code reflects :ref:`project
<compass-query-bar-project>`, :ref:`sort <compass-query-bar-sort>`,
:ref:`maxtimems <compass-query-bar-max-time-ms>`, :ref:`collation
<compass-query-bar-collation>`, :ref:`skip <compass-query-bar-skip>`, and
:ref:`limit <compass-query-bar-limit>` options.

.. step:: Click :icon-fa5:`copy`

Click the :icon-fa5:`copy` icon at the top-right corner of the formatted
query to copy the query for the selected language to your clipboard. You
can now integrate and execute your created query in your application.

.. figure:: /images/querybar/export-query-python-driver-syntax-copied.png
:figwidth: 600px
:alt: Copy button clicked in Export Query to Language modal

#. Click :guilabel:`Close` to return to the
:ref:`Documents Tab <compass-documents>`.
Learn More
----------

- :ref:`compass-export-agg-builder-results`
Binary file modified source/images/querybar/export-query-to-language-menu-option.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified source/images/querybar/export-query-to-language-select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions source/includes/shared/steps-open-new-tab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: Click the caret icon next to the database that contains the
collection you want to view.
level: 4
ref: click-caret
---
title: "Hover over the desired collection."
level: 4
ref: hover-collection
---
title: Click the appearing ellipses (...) button.
level: 4
ref: click-ellipses
---
title: Click :guilabel:`Open in New Tab`.
level: 4
ref: open-new-tab
...
2 changes: 2 additions & 0 deletions source/query-plan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ information on the execution of your query such as:

- The number of examined index keys

.. BEGIN-COMPASS-ONLY
.. note::

The :guilabel:`Explain Plan` is not available if you are connected
to :atlas:`Data Lake </data-lake>`.
.. END-COMPASS-ONLY

Steps
-----
Expand Down
2 changes: 2 additions & 0 deletions source/schema.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ with location data in |compass-short|, see :ref:`compass-analyze-location-data`.
:figwidth: 816px
:alt: Example of GeoJSON data types

.. BEGIN-COMPASS-ONLY
.. include:: /includes/fact-isolated-ver-third-party-mapping.rst
.. END-COMPASS-ONLY

View Charts of Mixed Types
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Loading