Skip to content

Commit 8ff8997

Browse files
committed
DOCSP-43493 adding /query example
1 parent ba7e421 commit 8ff8997

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

source/copilot.txt

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,41 @@ When the LLM generates a query, users can open the query in a playground
3030
file or run the query directly in their collection.
3131

3232
/query Example
33-
~~~~~~~~~~~~~~
33+
~~~~~~~~~~~~~~
34+
35+
Consider a ``fruits`` collection that contains documents with the
36+
following structure:
37+
38+
.. code-block:: javascript
39+
:copyable: false
40+
41+
{
42+
_id: 1,
43+
item: "tangerine",
44+
type: "citrus"
45+
}
46+
47+
48+
In the Github Copilot Chat tab, you can ask the MongoDB Copilot
49+
participant to generate a query to find all documents in the ``fruits``
50+
collection that have the type ``citrus``.
51+
52+
.. code-block:: javascript
53+
:copyable: false
54+
55+
@MongoDB /query find all documents in the fruits collection that have
56+
the type citrus
57+
58+
The Github Copilot Chat uses the MongoDB Copilot Participant to generate
59+
the following query using knowledge of your database schema:
60+
61+
.. code-block:: javascript
62+
63+
use('fruit');
64+
db.getCollection('fruit').find({ type: 'citrus' });
65+
66+
67+
68+
69+
70+

0 commit comments

Comments
 (0)