diff --git a/source/copilot-schema.txt b/source/copilot-schema.txt new file mode 100644 index 0000000..1cdd89e --- /dev/null +++ b/source/copilot-schema.txt @@ -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 +`__. +Each document in the collection has the following structure: + +.. code-block:: javascript + :copyable: false + + { + _id: { + "$oid": "59b99db4cfa9a34dcd7885b6" + }, + name: "Ned Stark", + email: "sean_bean@gameofthron.es", + 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. diff --git a/source/copilot.txt b/source/copilot.txt index 17774e6..630b2e9 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -32,6 +32,12 @@ Commands The ``/query`` command assists in generating queries from a natural language against a connected MongoDB cluster. +:ref:`/query ` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``schema`` command provides schema information about collections in +your connected deployment. + :ref:`/docs ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -42,6 +48,7 @@ supplement generated information. :titlesonly: /query + /schema /docs AI & Data Usage diff --git a/source/images/copilot-schema.png b/source/images/copilot-schema.png new file mode 100644 index 0000000..6ca3b09 Binary files /dev/null and b/source/images/copilot-schema.png differ