|
| 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. The |copilot| accesses your connected MongoDB deployment to |
| 16 | +provide schema information in the Copilot generated response. |
| 17 | + |
| 18 | +Examples |
| 19 | +-------- |
| 20 | + |
| 21 | +Provide a Sample Document |
| 22 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 23 | + |
| 24 | +Consider the ``users`` collection in the `Mflix Sample Database |
| 25 | +<https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__. |
| 26 | +If you are connected to the MongoDB deployment that contains this |
| 27 | +collection, you can ask the |copilot| to provide a sample document. |
| 28 | + |
| 29 | +.. code-block:: none |
| 30 | + :copyable: false |
| 31 | + |
| 32 | + @MongoDB /schema Can you show a sample document from the |
| 33 | + sample_mflix.users collection? |
| 34 | + |
| 35 | +The GitHub Copilot Chat uses the |copilot| to |
| 36 | +generate the following response using knowledge of your collection |
| 37 | +schema: |
| 38 | + |
| 39 | +.. code-block:: none |
| 40 | + :copyable: false |
| 41 | + |
| 42 | + Sure, here is a sample document from the sample_mflix.users |
| 43 | + collection: |
| 44 | + |
| 45 | + { |
| 46 | + "_id": { |
| 47 | + "$oid": "5f8473b823bca94021aa1c45" |
| 48 | + }, |
| 49 | + |
| 50 | + "name": "John Doe", |
| 51 | + "password": "password123", |
| 52 | + "preferences": {} |
| 53 | +} |
| 54 | + |
| 55 | +Once Copilot generates the response, you can open the JSON output to see |
| 56 | +more information. |
| 57 | + |
| 58 | +.. figure:: /images/copilot-schema.png |
| 59 | + :figwidth: 700px |
| 60 | + :alt: Screenshot of copilot providing a sample document from a |
| 61 | + collection. |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
0 commit comments