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
57 changes: 57 additions & 0 deletions source/copilot-export-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. _vsce-test-queries-copilot:

=======================
Export and Test Queries
=======================

.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol

You can use the :ref:`MongoDB Extension for Github Copilot
<vsce-copilot>` to export and test your application queries in
playgrounds.

.. note::

The :guilabel:`Export Code to Playground` feature is only available
if you enable |copilot|.

Export to Playground
--------------------

Use the following steps to test your application code in a playground:

.. procedure::
:style: normal

.. step:: Open the project file that contains the MongoDB query that you want to export.

.. step:: Highlight the query that you want to test.

.. step:: Right-click to select :guilabel:`Export Code to Playground`.

Right-click your selected code to open the options menu.
Click :guilabel:`MongoDB Copilot Extension` >
:guilabel:`Export Code to Playground`.

.. figure:: /images/export-to-playground.png
:alt: Screenshot of the export code to playground menu option.
:figwidth: 600px

When you click :guilabel:`Export Code to Playground`, |vscode-short|
opens a new playground with your selected code in MongoDB shell
syntax.

Once you export your code to a playground, you can click
:icon-fa5:`play` on the top right of your window to run your query.

.. seealso::

- :ref:`vsce-playgrounds`
- :ref:`vsce-copilot`

5 changes: 5 additions & 0 deletions source/export-to-language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ you want to export.

The tutorials on this page use the default playground template.

.. note::

.. include:: /includes/playground-require-copilot.rst

To open a new playground containing the default template:

.. include:: /includes/steps/open-new-playground.rst


Export a Query Document
-----------------------

Expand Down
Binary file added source/images/export-to-playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions source/includes/playground-require-copilot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
You can also open a new playground to test and export queries with the
:ref:`MongoDB Extension for Github Copilot <vsce-copilot>`. For more
information, see :ref:`Export and Test Queries with Copilot
<vsce-test-queries-copilot>`.
5 changes: 5 additions & 0 deletions source/playgrounds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ panel, the |vsce| *Overview* page, or the |vscode| Command Pallette.

.. include:: /includes/steps/open-new-playground.rst

.. note::

.. include:: /includes/playground-require-copilot.rst

Open a Saved Playground
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -266,4 +270,5 @@ Consideration for Authentication
Run Aggregation Pipelines </run-agg-pipelines>
Enable Autocomplete </enable-autocomplete-for-string-literals>
Export to Language </export-to-language>
Test Driver Queries </copilot-export-test>
Use require() </require-playgrounds>
Loading