@@ -38,35 +38,38 @@ file or run the query directly in your collection.
38
38
Example
39
39
~~~~~~~
40
40
41
- Consider a ``fruits`` collection that contains documents with the
42
- following structure:
41
+ Consider the ``users`` collection in the `Mflix Sample Database
42
+ <`https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__.
43
+ Each document in the collection has the following structure:
43
44
44
45
.. code-block:: javascript
45
46
:copyable: false
46
47
47
48
{
48
- _id: 1,
49
- item: "tangerine",
50
- type: "citrus"
49
+ _id: {
50
+ "$oid": "59b99db4cfa9a34dcd7885b6"
51
+ },
52
+ name: "Kayden Washington",
53
+
54
+ password: "11222021"
51
55
}
52
-
53
- Once you connect to the deployment that contains the ``fruits``
56
+ Once you connect to the deployment that contains the ``users``
54
57
collection, you can ask the Github Copilot chat to generate a query that
55
- finds all documents in the ``fruits `` collection that have the type
56
- ``citrus ``.
58
+ finds the document in the ``users `` collection that has the ``name``
59
+ value of `` "Kayden Washington" ``.
57
60
58
61
.. code-block:: javascript
59
62
:copyable: false
60
63
61
- @MongoDB /query find all documents in the fruits collection that have
62
- the type citrus
64
+ @MongoDB /query find a document in the users collection with the name
65
+ of Kayden Washington.
63
66
64
67
The Github Copilot Chat uses the MongoDB Github Copilot Participant to
65
68
generate the following query using knowledge of your database schema:
66
69
67
70
.. code-block:: javascript
68
71
69
- db.getCollection('fruits ').find ({ type : 'citrus ' })
72
+ db.getCollection('users ').findOne ({ name : 'Kayden Washington ' });
70
73
71
74
72
75
.. toctree::
0 commit comments