Skip to content
52 changes: 52 additions & 0 deletions source/copilot-schema.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _vsce-copilot-schema:

===============
/schema Command
===============

.. default-domain:: mongodb

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

The ``/schema`` command provides information about your collection
schema by accessing your connected MongoDB deployment.

Example
-------

This example uses the ``users`` collection in the `Mflix Sample Database
<https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
Each document in the collection has the following structure:

.. code-block:: javascript
:copyable: false

{
_id: {
"$oid": "59b99db4cfa9a34dcd7885b6"
},
name: "Ned Stark",
email: "[email protected]",
password: "$2b$12$UREFwsRUoyF0CRqGNK0LzO0HM/jLhgUCNNIJ9RJAqMUQ74crlJ1Vu"
}


If you are connected to a MongoDB deployment that contains this
collection, you can ask the |copilot| to show the schema of your collection:

.. code-block:: none
:copyable: false

@MongoDB /schema Can you show the schema for the sample_mflix.users
collection?

GitHub Copilot uses the |copilot| to generate the following response:

.. figure:: /images/copilot-schema.png
:figwidth: 600px
:alt: Screenshot of copilot generated a schema description

After Copilot generates the response, you can open the output in JSON format.
7 changes: 7 additions & 0 deletions source/copilot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ Commands
The ``/query`` command assists in generating queries from a natural
language against a connected MongoDB cluster.

:ref:`/query <vsce-copilot-schema>`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``schema`` command provides schema information about collections in
your connected deployment.

.. toctree::
:titlesonly:

/query </copilot-query>
/schema </copilot-schema>
AI & Data Usage </ai-data-usage>


Binary file added source/images/copilot-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading