File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ .. _vsce-copilot-schema:
2+
3+ ===============
4+ /schema Command
5+ ===============
6+
7+ .. default-domain:: mongodb
8+
9+ .. contents:: On this page
10+ :local:
11+ :backlinks: none
12+ :depth: 1
13+
14+ The ``/schema`` command provides information about your collection
15+ schema by accessing your connected MongoDB deployment.
16+
17+ Example
18+ -------
19+
20+ This example uses the ``users`` collection in the `Mflix Sample Database
21+ <https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
22+ Each document in the collection has the following structure:
23+
24+ .. code-block:: javascript
25+ :copyable: false
26+
27+ {
28+ _id: {
29+ "$oid": "59b99db4cfa9a34dcd7885b6"
30+ },
31+ name: "Ned Stark",
32+ 33+ password: "$2b$12$UREFwsRUoyF0CRqGNK0LzO0HM/jLhgUCNNIJ9RJAqMUQ74crlJ1Vu"
34+ }
35+
36+
37+ If you are connected to a MongoDB deployment that contains this
38+ collection, you can ask the |copilot| to show the schema of your collection:
39+
40+ .. code-block:: none
41+ :copyable: false
42+
43+ @MongoDB /schema Can you show the schema for the sample_mflix.users
44+ collection?
45+
46+ GitHub Copilot uses the |copilot| to generate the following response:
47+
48+ .. figure:: /images/copilot-schema.png
49+ :figwidth: 600px
50+ :alt: Screenshot of copilot generated a schema description
51+
52+ After Copilot generates the response, you can open the output in JSON format.
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ Commands
3232The ``/query`` command assists in generating queries from a natural
3333language against a connected MongoDB cluster.
3434
35+ :ref:`/query <vsce-copilot-schema>`
36+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
38+ The ``schema`` command provides schema information about collections in
39+ your connected deployment.
40+
3541:ref:`/docs <vsce-copilot-docs>`
3642~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3743
@@ -42,6 +48,7 @@ supplement generated information.
4248 :titlesonly:
4349
4450 /query </copilot-query>
51+ /schema </copilot-schema>
4552 /docs </copilot-docs>
4653 AI & Data Usage </ai-data-usage>
4754
You can’t perform that action at this time.
0 commit comments