From 89c782678e3f609976b980fb8ea141d61a26d05f Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Wed, 11 Sep 2024 15:29:58 -0400 Subject: [PATCH 01/21] DOCSP-43493 adding copilot page --- source/copilot.txt | 13 +++++++++++++ source/index.txt | 1 + 2 files changed, 14 insertions(+) create mode 100644 source/copilot.txt diff --git a/source/copilot.txt b/source/copilot.txt new file mode 100644 index 00000000..33994c4b --- /dev/null +++ b/source/copilot.txt @@ -0,0 +1,13 @@ +.. _vsce-copilot: + +============================== +Github Copilot for |vsce-full| +============================== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol \ No newline at end of file diff --git a/source/index.txt b/source/index.txt index 00db06e8..ae14cf5c 100644 --- a/source/index.txt +++ b/source/index.txt @@ -56,6 +56,7 @@ Get Started /connect /databases-collections /playgrounds + /copilot /create-cluster-terraform /reference Changelog From 02b3217edd6914906c6293da0911d3b01b736ba1 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Wed, 11 Sep 2024 15:55:31 -0400 Subject: [PATCH 02/21] DOCSP-43493 adding copilot page --- source/copilot.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/copilot.txt b/source/copilot.txt index 33994c4b..5a361d7e 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -1,8 +1,8 @@ .. _vsce-copilot: -============================== -Github Copilot for |vsce-full| -============================== +================================== +MongoDB Github Copilot Participant +================================== .. default-domain:: mongodb @@ -10,4 +10,11 @@ Github Copilot for |vsce-full| :local: :backlinks: none :depth: 1 - :class: singlecol \ No newline at end of file + :class: singlecol + + +|vsce-full| automatically includes a MongoDB Github Copilot Participant +to assist in using Copilot with your MongoDB deployments. Through +Copilot's chat feature, users with |vsce| can engage with their coding +environment with MongoDB doman-specific knowledge on top of +VSCode Copilot's LLM. \ No newline at end of file From 4be41f091e2839b0208b66c04c6c5be82a5d7772 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Thu, 12 Sep 2024 10:03:33 -0400 Subject: [PATCH 03/21] DOCSP-43493 adding copilot page --- source/copilot.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source/copilot.txt b/source/copilot.txt index 5a361d7e..125cc21b 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -15,6 +15,19 @@ MongoDB Github Copilot Participant |vsce-full| automatically includes a MongoDB Github Copilot Participant to assist in using Copilot with your MongoDB deployments. Through -Copilot's chat feature, users with |vsce| can engage with their coding -environment with MongoDB doman-specific knowledge on top of -VSCode Copilot's LLM. \ No newline at end of file +Copilot's chat feature, users with |vsce| can interact their MongoDB +clusters and generate code with MongoDB domain-specific knowledge on top +of VSCode Copilot's LLM. + +/query +------ + +Users can use the ``/query`` command to generate queries from a natural +language against a connected MongoDB cluster. The MongoDB Participant +provides underlying schema information of the relevant collections and +MongoDB domain specific knowledge to Copilot to generate a response. +When the LLM generates a query, users can open the query in a playground +file or run the query directly in their collection. + +/query Example +~~~~~~~~~~~~~~ \ No newline at end of file From 92b43156b981dd0bf590b8545dcd223ed4d3a725 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Mon, 16 Sep 2024 16:09:34 -0400 Subject: [PATCH 04/21] DOCSP-43493 adding /query example --- source/copilot.txt | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/source/copilot.txt b/source/copilot.txt index 125cc21b..87e212b4 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -30,4 +30,41 @@ When the LLM generates a query, users can open the query in a playground file or run the query directly in their collection. /query Example -~~~~~~~~~~~~~~ \ No newline at end of file +~~~~~~~~~~~~~~ + +Consider a ``fruits`` collection that contains documents with the +following structure: + +.. code-block:: javascript + :copyable: false + + { + _id: 1, + item: "tangerine", + type: "citrus" + } + + +In the Github Copilot Chat tab, you can ask the MongoDB Copilot +participant to generate a query to find all documents in the ``fruits`` +collection that have the type ``citrus``. + +.. code-block:: javascript + :copyable: false + + @MongoDB /query find all documents in the fruits collection that have + the type citrus + +The Github Copilot Chat uses the MongoDB Copilot Participant to generate +the following query using knowledge of your database schema: + +.. code-block:: javascript + + use('fruit'); + db.getCollection('fruit').find({ type: 'citrus' }); + + + + + + From 172179e4e74ea77e5e13e21b6b097e2bff1c36a5 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Mon, 16 Sep 2024 16:23:49 -0400 Subject: [PATCH 05/21] DOCSP-43493 adding /query example --- source/copilot.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/copilot.txt b/source/copilot.txt index 87e212b4..ab428736 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -60,8 +60,8 @@ the following query using knowledge of your database schema: .. code-block:: javascript - use('fruit'); - db.getCollection('fruit').find({ type: 'citrus' }); + use('fruits'); + db.getCollection('fruits').find({ type: 'citrus' }); From 3b0d9bf23532d967635342b25adeeb2fbe92de92 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Tue, 17 Sep 2024 11:24:36 -0400 Subject: [PATCH 06/21] DOCSP-43493 adding ai and data usage --- source/ai-data-usage.txt | 41 ++++++++++++++++++++++++++++++++++++++++ source/copilot.txt | 31 ++++++++++++++++-------------- 2 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 source/ai-data-usage.txt diff --git a/source/ai-data-usage.txt b/source/ai-data-usage.txt new file mode 100644 index 00000000..5502dd71 --- /dev/null +++ b/source/ai-data-usage.txt @@ -0,0 +1,41 @@ +.. vscode-ai-data-usage: + +============================= +AI and Data Usage Information +============================= + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + +The MongoDB Github Copilot Participant is powered by Generative AI (Gen +AI), and may give inaccurate responses. See our `Generative AI FAQ +`__ for more +information about Gen AI in MongoDB products. + +Third Party Providers +--------------------- + +The MongoDB Github Copilot Participant is powered by Github Copilot. +This is subject to change in the future. + +How Your Data is Used +--------------------- + +When you use the MongoDB Github Copilot Participant, the following +information is sent to MongoDB's backend and/or the third party AI +provider: + +- The full text of your natural language prompt. +- The schema of the collection you are using, + including database name, collection name, field names, and types. +- Enable sending sample field values. This is an optional setting to + improve the quality of recommendations. You can manage this through the + ``Enable sending sample field values`` setting in + :ref:`Compass settings `. This setting + is off by default. + +The information that is sent will not be shared with any other third +parties or stored by the AI provider. We do not send database +connection strings, credentials, or rows/documents from your databases. diff --git a/source/copilot.txt b/source/copilot.txt index ab428736..9304e175 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -13,7 +13,7 @@ MongoDB Github Copilot Participant :class: singlecol -|vsce-full| automatically includes a MongoDB Github Copilot Participant +|vsce-full| includes a MongoDB Github Copilot Participant to assist in using Copilot with your MongoDB deployments. Through Copilot's chat feature, users with |vsce| can interact their MongoDB clusters and generate code with MongoDB domain-specific knowledge on top @@ -22,15 +22,18 @@ of VSCode Copilot's LLM. /query ------ -Users can use the ``/query`` command to generate queries from a natural -language against a connected MongoDB cluster. The MongoDB Participant -provides underlying schema information of the relevant collections and -MongoDB domain specific knowledge to Copilot to generate a response. +Users can use the ``/query`` command in the Copilot chat to +generate queries from a natural language against a connected MongoDB +cluster. The MongoDB Participant provides underlying schema information +of the relevant collections to Copilot to generate a response. If you do +not specify a collection in your prompt to Copilot, the MongoDB +Participant prompts you to select a relevant collection. + When the LLM generates a query, users can open the query in a playground file or run the query directly in their collection. -/query Example -~~~~~~~~~~~~~~ +Example +~~~~~~~ Consider a ``fruits`` collection that contains documents with the following structure: @@ -44,10 +47,9 @@ following structure: type: "citrus" } - -In the Github Copilot Chat tab, you can ask the MongoDB Copilot -participant to generate a query to find all documents in the ``fruits`` -collection that have the type ``citrus``. +Once you connet to the databse that contains the ``fruits`` collection, +you can ask the Copilot chat to generate a query that finds all documents +in the ``fruits`` collection that have the type ``citrus``. .. code-block:: javascript :copyable: false @@ -60,11 +62,12 @@ the following query using knowledge of your database schema: .. code-block:: javascript - use('fruits'); - db.getCollection('fruits').find({ type: 'citrus' }); - + db.getCollection('fruits').find({ type: 'citrus' }) +.. toctree:: + :titlesonly: + /ai-data-usage From fb2cd61100d7639025201e9a05c21c92f74e28d2 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Tue, 17 Sep 2024 11:29:05 -0400 Subject: [PATCH 07/21] DOCSP-43493 adding ai and data usage --- source/ai-data-usage.txt | 7 +------ source/copilot.txt | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/source/ai-data-usage.txt b/source/ai-data-usage.txt index 5502dd71..8e4f8267 100644 --- a/source/ai-data-usage.txt +++ b/source/ai-data-usage.txt @@ -17,7 +17,7 @@ information about Gen AI in MongoDB products. Third Party Providers --------------------- -The MongoDB Github Copilot Participant is powered by Github Copilot. +The MongoDB Github Copilot Participant is powered by `Github Copilot __. This is subject to change in the future. How Your Data is Used @@ -30,11 +30,6 @@ provider: - The full text of your natural language prompt. - The schema of the collection you are using, including database name, collection name, field names, and types. -- Enable sending sample field values. This is an optional setting to - improve the quality of recommendations. You can manage this through the - ``Enable sending sample field values`` setting in - :ref:`Compass settings `. This setting - is off by default. The information that is sent will not be shared with any other third parties or stored by the AI provider. We do not send database diff --git a/source/copilot.txt b/source/copilot.txt index 9304e175..6010362c 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -68,6 +68,6 @@ the following query using knowledge of your database schema: .. toctree:: :titlesonly: - /ai-data-usage + AI & Data Usage From ad7a58daebd6a5734c18132c8cebe16780e064f5 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Tue, 17 Sep 2024 13:25:37 -0400 Subject: [PATCH 08/21] DOCSP-43493 adding ai and data usage --- snooty.toml | 3 ++- source/ai-data-usage.txt | 2 +- source/copilot.txt | 34 +++++++++++++++++++--------------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/snooty.toml b/snooty.toml index 0e4a0203..931aab22 100644 --- a/snooty.toml +++ b/snooty.toml @@ -10,7 +10,8 @@ toc_landing_pages = [ "/playgrounds", "/crud-ops", "/playground-databases", - "/require-playgrounds" + "/require-playgrounds", + "/copilot" ] [constants] diff --git a/source/ai-data-usage.txt b/source/ai-data-usage.txt index 8e4f8267..368ac2e3 100644 --- a/source/ai-data-usage.txt +++ b/source/ai-data-usage.txt @@ -17,7 +17,7 @@ information about Gen AI in MongoDB products. Third Party Providers --------------------- -The MongoDB Github Copilot Participant is powered by `Github Copilot __. +The MongoDB Github Copilot Participant is powered by `Github Copilot `__. This is subject to change in the future. How Your Data is Used diff --git a/source/copilot.txt b/source/copilot.txt index 6010362c..17ea395a 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -13,21 +13,24 @@ MongoDB Github Copilot Participant :class: singlecol -|vsce-full| includes a MongoDB Github Copilot Participant -to assist in using Copilot with your MongoDB deployments. Through -Copilot's chat feature, users with |vsce| can interact their MongoDB -clusters and generate code with MongoDB domain-specific knowledge on top -of VSCode Copilot's LLM. +|vsce-full| includes a MongoDB Github Copilot Participant to assist in +using `Github Copilot `__ with your +MongoDB deployments. Through Github Copilot's chat feature, users with +|vsce| can interact with their MongoDB clusters and generate code with +MongoDB domain-specific knowledge on top of Github Copilot's LLM. + +The MongoDB Github Copilot Participant includes MongoDB-specific +commands to assist in interacting with your deployment. /query ------ -Users can use the ``/query`` command in the Copilot chat to +Users can use the ``/query`` command in the Github Copilot chat to generate queries from a natural language against a connected MongoDB -cluster. The MongoDB Participant provides underlying schema information -of the relevant collections to Copilot to generate a response. If you do -not specify a collection in your prompt to Copilot, the MongoDB -Participant prompts you to select a relevant collection. +cluster. The MongoDB Github Copilot Participant provides underlying +schema information of the relevant collections to Github Copilot to +generate a response. If you do not specify a collection in your prompt, +the chat prompts you to select a relevant collection. When the LLM generates a query, users can open the query in a playground file or run the query directly in their collection. @@ -47,9 +50,10 @@ following structure: type: "citrus" } -Once you connet to the databse that contains the ``fruits`` collection, -you can ask the Copilot chat to generate a query that finds all documents -in the ``fruits`` collection that have the type ``citrus``. +Once you connect to the deployment that contains the ``fruits`` +collection, you can ask the Github Copilot chat to generate a query that +finds all documents in the ``fruits`` collection that have the type +``citrus``. .. code-block:: javascript :copyable: false @@ -57,8 +61,8 @@ in the ``fruits`` collection that have the type ``citrus``. @MongoDB /query find all documents in the fruits collection that have the type citrus -The Github Copilot Chat uses the MongoDB Copilot Participant to generate -the following query using knowledge of your database schema: +The Github Copilot Chat uses the MongoDB Github Copilot Participant to +generate the following query using knowledge of your database schema: .. code-block:: javascript From 4f22c050b2c1c5e1877ba3f75ca1ca8d3b3e1e50 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Tue, 17 Sep 2024 13:33:54 -0400 Subject: [PATCH 09/21] DOCSP-43493 adding ai and data usage --- source/copilot.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/copilot.txt b/source/copilot.txt index 17ea395a..631efef9 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -25,15 +25,15 @@ commands to assist in interacting with your deployment. /query ------ -Users can use the ``/query`` command in the Github Copilot chat to -generate queries from a natural language against a connected MongoDB -cluster. The MongoDB Github Copilot Participant provides underlying -schema information of the relevant collections to Github Copilot to -generate a response. If you do not specify a collection in your prompt, -the chat prompts you to select a relevant collection. - -When the LLM generates a query, users can open the query in a playground -file or run the query directly in their collection. +The ``/query`` command assists in generating queries from a natural +language against a connected MongoDB cluster. The MongoDB Github Copilot +Participant provides underlying schema information of the relevant +collections to Github Copilot to generate a response. If you do not +specify a collection in your prompt, the chat prompts you to select a +relevant collection. + +When the LLM generates a query, you can open the query in a playground +file or run the query directly in your collection. Example ~~~~~~~ From fed6b9fdc95fa460a3f8f3eba68efa8eeb837557 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Tue, 17 Sep 2024 16:58:01 -0400 Subject: [PATCH 10/21] DOCSP-43493 using sample database --- source/copilot.txt | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/source/copilot.txt b/source/copilot.txt index 631efef9..d282735e 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -38,35 +38,38 @@ file or run the query directly in your collection. Example ~~~~~~~ -Consider a ``fruits`` collection that contains documents with the -following structure: +Consider the ``users`` collection in the `Mflix Sample Database +<`https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__. +Each document in the collection has the following structure: .. code-block:: javascript :copyable: false { - _id: 1, - item: "tangerine", - type: "citrus" + _id: { + "$oid": "59b99db4cfa9a34dcd7885b6" + }, + name: "Kayden Washington", + email: "KW@email.com", + password: "11222021" } - -Once you connect to the deployment that contains the ``fruits`` +Once you connect to the deployment that contains the ``users`` collection, you can ask the Github Copilot chat to generate a query that -finds all documents in the ``fruits`` collection that have the type -``citrus``. +finds the document in the ``users`` collection that has the ``name`` +value of `` "Kayden Washington"``. .. code-block:: javascript :copyable: false - @MongoDB /query find all documents in the fruits collection that have - the type citrus + @MongoDB /query find a document in the users collection with the name + of Kayden Washington. The Github Copilot Chat uses the MongoDB Github Copilot Participant to generate the following query using knowledge of your database schema: .. code-block:: javascript - db.getCollection('fruits').find({ type: 'citrus' }) + db.getCollection('users').findOne({ name: 'Kayden Washington' }); .. toctree:: From 7f5915b81b155f6e6dc1642339b49065163928ea Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Tue, 17 Sep 2024 17:00:36 -0400 Subject: [PATCH 11/21] DOCSP-43493 using sample database --- source/copilot.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/copilot.txt b/source/copilot.txt index d282735e..1af7de47 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -39,7 +39,7 @@ Example ~~~~~~~ Consider the ``users`` collection in the `Mflix Sample Database -<`https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/#sample_mflix.users>`__. +`__. Each document in the collection has the following structure: .. code-block:: javascript From 824ff269602f0989a87f114d41f7838f44940eb7 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Thu, 19 Sep 2024 09:35:51 -0400 Subject: [PATCH 12/21] DOCSP-43493 tech edits --- source/ai-data-usage.txt | 1 - source/copilot.txt | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ai-data-usage.txt b/source/ai-data-usage.txt index 368ac2e3..37625ae6 100644 --- a/source/ai-data-usage.txt +++ b/source/ai-data-usage.txt @@ -18,7 +18,6 @@ Third Party Providers --------------------- The MongoDB Github Copilot Participant is powered by `Github Copilot `__. -This is subject to change in the future. How Your Data is Used --------------------- diff --git a/source/copilot.txt b/source/copilot.txt index 1af7de47..b09762c9 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -17,7 +17,10 @@ MongoDB Github Copilot Participant using `Github Copilot `__ with your MongoDB deployments. Through Github Copilot's chat feature, users with |vsce| can interact with their MongoDB clusters and generate code with -MongoDB domain-specific knowledge on top of Github Copilot's LLM. +MongoDB domain-specific knowledge on top of Github Copilot's LLM. The +MongoDB Copilot Participant can also answer questions about your +database collection schema and provide links to specific MongoDB +documentation. The MongoDB Github Copilot Participant includes MongoDB-specific commands to assist in interacting with your deployment. From 1ebb8cea69bafa2ac01a3657b8c323749bc892ae Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Thu, 19 Sep 2024 10:22:20 -0400 Subject: [PATCH 13/21] DOCSP-43493 adding agg pipeline example --- snooty.toml | 1 + source/copilot-query.txt | 123 +++++++++++++++++++++++++++++++++++++++ source/copilot.txt | 50 ++-------------- 3 files changed, 130 insertions(+), 44 deletions(-) create mode 100644 source/copilot-query.txt diff --git a/snooty.toml b/snooty.toml index 931aab22..566d2c80 100644 --- a/snooty.toml +++ b/snooty.toml @@ -41,6 +41,7 @@ cifs = ":abbr:`CIFS (Common Internet File System)`" cps = ":abbr:`CPS (Cloud Provider Snapshots)`" cmk = ":abbr:`CMK (customer master key)`" compass = "MongoDB Compass" +copilot = "MongoDB Github Copilot Participant" data-lakes = "Data Lakes" data-lake = "Data Lake" datadog = "`Datadog `__" diff --git a/source/copilot-query.txt b/source/copilot-query.txt new file mode 100644 index 00000000..6a28d5fc --- /dev/null +++ b/source/copilot-query.txt @@ -0,0 +1,123 @@ +.. _vsce-copilot-query: + +============== +/query Command +============== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +The ``/query`` command assists in generating queries from a natural +language against a connected MongoDB cluster. The MongoDB Github Copilot +Participant provides underlying schema information of the relevant +collections to Github Copilot to generate a response. If you do not +specify a collection in your prompt, the chat prompts you to select a +relevant collection. + +When the LLM generates a query, you can open the query in a playground +file or run the query directly in your collection. + +Examples +~~~~~~~~ + +Generate a Query +```````````````` + +Consider 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: "Kayden Washington", + email: "KW@email.com", + password: "11222021" + } + +Once you connect to the deployment that contains the ``users`` +collection, you can ask the Github Copilot chat to generate a query that +finds the document in the ``users`` collection that has the ``name`` +value of `` "Kayden Washington"``. + +.. code-block:: javascript + :copyable: false + + @MongoDB /query find a document in the users collection with the name + of Kayden Washington. + +The Github Copilot Chat uses the MongoDB Github Copilot Participant to +generate the following query using knowledge of your database schema: + +.. code-block:: javascript + + db.getCollection('users').findOne({ name: 'Kayden Washington' }); + +Once the MongoDB Github Copilot Participant generates the query, you can choose to run the query directly or open the query in a playground. + +Build an Aggregation Pipeline +````````````````````````````` + +Consider 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: "Kayden Washington", + email: "KW@email.com", + password: "11222021" + } + +Once you connect to the deployment that contains the ``users`` +collection, you can ask the Github Copilot chat to generate an aggregation pipeline. + +.. code-block:: javascript + :copyable: false + + @MongoDB /query Generate an aggregation pipeline on the users collection that first sorts documents alphabetically by name and then removes the password field from each document. + +The |copilot| generates the following aggregation pipeline: + +.. code-block:: javascript + + db.getCollection('users').aggregate([ + // First stage: Sort documents alphabetically by name + { $sort: { name: 1 } }, + // Second stage: Remove the password field from each document + { $unset: "password" } + ]); + +You can also iteratively build on your aggregation pipeline. + +.. code-block:: javascript + :copyable: false + + @MongoDB /query Add a stage to my pipeline that adds a username field ot each document containing the user's email username without the email domain. + +The |copilot| returns the following aggregation pipeline: + +.. code-block:: javascript + + db.getCollection('users').aggregate([ + { $sort: { name: 1 } }, + { $project: { password: 0 } }, + { $addFields: + { username: { $arrayElemAt: + [{ $split: ["$email", "@"] }, 0] } } }, + { $out: "sortedUsersWithUsernames" } + ]); diff --git a/source/copilot.txt b/source/copilot.txt index b09762c9..00cabe1f 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -12,7 +12,6 @@ MongoDB Github Copilot Participant :depth: 1 :class: singlecol - |vsce-full| includes a MongoDB Github Copilot Participant to assist in using `Github Copilot `__ with your MongoDB deployments. Through Github Copilot's chat feature, users with @@ -25,59 +24,22 @@ documentation. The MongoDB Github Copilot Participant includes MongoDB-specific commands to assist in interacting with your deployment. +Commands +-------- + /query ------- +~~~~~~ The ``/query`` command assists in generating queries from a natural -language against a connected MongoDB cluster. The MongoDB Github Copilot -Participant provides underlying schema information of the relevant -collections to Github Copilot to generate a response. If you do not -specify a collection in your prompt, the chat prompts you to select a -relevant collection. - -When the LLM generates a query, you can open the query in a playground -file or run the query directly in your collection. - -Example -~~~~~~~ - -Consider 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: "Kayden Washington", - email: "KW@email.com", - password: "11222021" - } -Once you connect to the deployment that contains the ``users`` -collection, you can ask the Github Copilot chat to generate a query that -finds the document in the ``users`` collection that has the ``name`` -value of `` "Kayden Washington"``. - -.. code-block:: javascript - :copyable: false - - @MongoDB /query find a document in the users collection with the name - of Kayden Washington. +language against a connected MongoDB cluster. -The Github Copilot Chat uses the MongoDB Github Copilot Participant to -generate the following query using knowledge of your database schema: -.. code-block:: javascript - - db.getCollection('users').findOne({ name: 'Kayden Washington' }); .. toctree:: :titlesonly: + /query AI & Data Usage From 270dc4eb5ea61dc6cf7da8b3179c359bf9f45029 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Thu, 19 Sep 2024 10:26:06 -0400 Subject: [PATCH 14/21] DOCSP-43493 adding agg pipeline example --- source/copilot-query.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/copilot-query.txt b/source/copilot-query.txt index 6a28d5fc..54367ca3 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -47,7 +47,7 @@ Each document in the collection has the following structure: Once you connect to the deployment that contains the ``users`` collection, you can ask the Github Copilot chat to generate a query that finds the document in the ``users`` collection that has the ``name`` -value of `` "Kayden Washington"``. +value of ``Kayden Washington``. .. code-block:: javascript :copyable: false @@ -89,7 +89,9 @@ collection, you can ask the Github Copilot chat to generate an aggregation pipel .. code-block:: javascript :copyable: false - @MongoDB /query Generate an aggregation pipeline on the users collection that first sorts documents alphabetically by name and then removes the password field from each document. + @MongoDB /query Generate an aggregation pipeline on the users + collection that first sorts documents alphabetically by name and then + removes the password field from each document. The |copilot| generates the following aggregation pipeline: @@ -107,7 +109,9 @@ You can also iteratively build on your aggregation pipeline. .. code-block:: javascript :copyable: false - @MongoDB /query Add a stage to my pipeline that adds a username field ot each document containing the user's email username without the email domain. + @MongoDB /query Add a stage to my pipeline that adds a username field + of each document containing the user's email username without the + email domain. The |copilot| returns the following aggregation pipeline: From 9949ef9f128be9a0b70e081ec53dd1853d2e97e0 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Thu, 19 Sep 2024 10:35:16 -0400 Subject: [PATCH 15/21] DOCSP-43493 updating snooty.toml --- source/copilot-query.txt | 13 ++++++------- source/copilot.txt | 22 +++++++++------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/source/copilot-query.txt b/source/copilot-query.txt index 54367ca3..7a29b898 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -13,11 +13,10 @@ :class: singlecol The ``/query`` command assists in generating queries from a natural -language against a connected MongoDB cluster. The MongoDB Github Copilot -Participant provides underlying schema information of the relevant -collections to Github Copilot to generate a response. If you do not -specify a collection in your prompt, the chat prompts you to select a -relevant collection. +language against a connected MongoDB cluster. The |copilot| provides +underlying schema information of the relevant collections to Github +Copilot to generate a response. If you do not specify a collection in +your prompt, the chat prompts you to select a relevant collection. When the LLM generates a query, you can open the query in a playground file or run the query directly in your collection. @@ -55,14 +54,14 @@ value of ``Kayden Washington``. @MongoDB /query find a document in the users collection with the name of Kayden Washington. -The Github Copilot Chat uses the MongoDB Github Copilot Participant to +The Github Copilot Chat uses the |copilot| to generate the following query using knowledge of your database schema: .. code-block:: javascript db.getCollection('users').findOne({ name: 'Kayden Washington' }); -Once the MongoDB Github Copilot Participant generates the query, you can choose to run the query directly or open the query in a playground. +Once the |copilot| generates the query, you can choose to run the query directly or open the query in a playground. Build an Aggregation Pipeline ````````````````````````````` diff --git a/source/copilot.txt b/source/copilot.txt index 00cabe1f..90659953 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -1,7 +1,7 @@ .. _vsce-copilot: ================================== -MongoDB Github Copilot Participant +|copilot| ================================== .. default-domain:: mongodb @@ -12,16 +12,15 @@ MongoDB Github Copilot Participant :depth: 1 :class: singlecol -|vsce-full| includes a MongoDB Github Copilot Participant to assist in -using `Github Copilot `__ with your -MongoDB deployments. Through Github Copilot's chat feature, users with -|vsce| can interact with their MongoDB clusters and generate code with -MongoDB domain-specific knowledge on top of Github Copilot's LLM. The -MongoDB Copilot Participant can also answer questions about your -database collection schema and provide links to specific MongoDB -documentation. +|vsce-full| includes the |copilot| to assist in using `Github Copilot +`__ with your MongoDB deployments. +Through Github Copilot's chat feature, users with |vsce| can interact +with their MongoDB clusters and generate code with MongoDB +domain-specific knowledge on top of Github Copilot's LLM. The |copilot +can also answer questions about your database collection schema and +provide links to specific MongoDB documentation. -The MongoDB Github Copilot Participant includes MongoDB-specific +The |copilot| includes MongoDB-specific commands to assist in interacting with your deployment. Commands @@ -33,9 +32,6 @@ Commands The ``/query`` command assists in generating queries from a natural language against a connected MongoDB cluster. - - - .. toctree:: :titlesonly: From ed3d79483f25ae63163ea6d05f536cd63a1eed35 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Thu, 19 Sep 2024 10:40:27 -0400 Subject: [PATCH 16/21] DOCSP-43493 * --- source/copilot-query.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/copilot-query.txt b/source/copilot-query.txt index 7a29b898..5a6e3965 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -66,7 +66,7 @@ Once the |copilot| generates the query, you can choose to run the query directly Build an Aggregation Pipeline ````````````````````````````` -Consider the ``users`` collection in the `Mflix Sample Database +You can also use the |copilot| to build aggregation pipelines. Consider the ``users`` collection in the `Mflix Sample Database `__. Each document in the collection has the following structure: @@ -103,13 +103,13 @@ The |copilot| generates the following aggregation pipeline: { $unset: "password" } ]); -You can also iteratively build on your aggregation pipeline. +You can also iteratively build on your aggregation pipeline: .. code-block:: javascript :copyable: false @MongoDB /query Add a stage to my pipeline that adds a username field - of each document containing the user's email username without the + to each document containing the user's email without the email domain. The |copilot| returns the following aggregation pipeline: From 1d4d0a6abbe4797622e98a3a4686381ebc0aada4 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Fri, 20 Sep 2024 10:28:23 -0400 Subject: [PATCH 17/21] DOCSP-43493 adding query 1 image --- source/copilot-query.txt | 7 ++- source/images/copilot-query.png | 86 +++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 source/images/copilot-query.png diff --git a/source/copilot-query.txt b/source/copilot-query.txt index 5a6e3965..70101707 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -61,7 +61,12 @@ generate the following query using knowledge of your database schema: db.getCollection('users').findOne({ name: 'Kayden Washington' }); -Once the |copilot| generates the query, you can choose to run the query directly or open the query in a playground. +Once the |copilot| generates the query, you can choose to run the query +directly or open the query in a playground. + + .. figure:: /images/copilot-query.png + :figwidth: 700px + :alt: Image copilot generating a query Build an Aggregation Pipeline ````````````````````````````` diff --git a/source/images/copilot-query.png b/source/images/copilot-query.png new file mode 100644 index 00000000..0f71c356 --- /dev/null +++ b/source/images/copilot-query.png @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + Copilot_user + + From 5adb7b1e1682fd342e01c3061e8d9d3d88491b67 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Fri, 20 Sep 2024 10:50:57 -0400 Subject: [PATCH 18/21] DOCSP-43493 adding screenshots --- source/copilot-query.txt | 36 +++++++----- source/images/copilot-agg-pipeline.png | 47 ++++++++++++++++ source/images/copilot-agg-pipeline2.png | 47 ++++++++++++++++ source/images/copilot-query.png | 75 ++++++------------------- 4 files changed, 135 insertions(+), 70 deletions(-) create mode 100644 source/images/copilot-agg-pipeline.png create mode 100644 source/images/copilot-agg-pipeline2.png diff --git a/source/copilot-query.txt b/source/copilot-query.txt index 70101707..f35aa269 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -51,27 +51,29 @@ value of ``Kayden Washington``. .. code-block:: javascript :copyable: false - @MongoDB /query find a document in the users collection with the name - of Kayden Washington. + @MongoDB /query In the sample_mflix database, find a document in the + users collection with the name of Kayden Washington. The Github Copilot Chat uses the |copilot| to generate the following query using knowledge of your database schema: .. code-block:: javascript + use(`sample_mflix`); db.getCollection('users').findOne({ name: 'Kayden Washington' }); Once the |copilot| generates the query, you can choose to run the query directly or open the query in a playground. - .. figure:: /images/copilot-query.png - :figwidth: 700px - :alt: Image copilot generating a query +.. figure:: /images/copilot-query.png + :figwidth: 700px + :alt: Screenshot of copilot generating a query Build an Aggregation Pipeline ````````````````````````````` -You can also use the |copilot| to build aggregation pipelines. Consider the ``users`` collection in the `Mflix Sample Database +You can also use the |copilot| to build aggregation pipelines. Consider +the ``users`` collection in the `Mflix Sample Database `__. Each document in the collection has the following structure: @@ -101,13 +103,19 @@ The |copilot| generates the following aggregation pipeline: .. code-block:: javascript + use('sample_mflix'); db.getCollection('users').aggregate([ - // First stage: Sort documents alphabetically by name { $sort: { name: 1 } }, - // Second stage: Remove the password field from each document - { $unset: "password" } + { $project: { password: 0 } } ]); +Once the |copilot| generates the query, you can choose to run the pipeline +directly or open the pipeline in a playground. + +.. figure:: /images/copilot-agg-pipeline.png + :figwidth: 700px + :alt: Screenshot of copilot generating an aggregation pipeline + You can also iteratively build on your aggregation pipeline: .. code-block:: javascript @@ -121,11 +129,13 @@ The |copilot| returns the following aggregation pipeline: .. code-block:: javascript + use('sample_mflix'); db.getCollection('users').aggregate([ { $sort: { name: 1 } }, { $project: { password: 0 } }, - { $addFields: - { username: { $arrayElemAt: - [{ $split: ["$email", "@"] }, 0] } } }, - { $out: "sortedUsersWithUsernames" } + { $addFields: { username: { $arrayElemAt: [{ $split: ["$email", "@"] }, 0] } } } ]); + +.. figure:: /images/copilot-agg-pipeline2.png + :figwidth: 700px + :alt: Screenshot of copilot iteratively building on an aggregation pipeline diff --git a/source/images/copilot-agg-pipeline.png b/source/images/copilot-agg-pipeline.png new file mode 100644 index 00000000..3819dbf8 --- /dev/null +++ b/source/images/copilot-agg-pipeline.png @@ -0,0 +1,47 @@ + + + + + + + + + + + Copilot_user + + diff --git a/source/images/copilot-agg-pipeline2.png b/source/images/copilot-agg-pipeline2.png new file mode 100644 index 00000000..d81d6e84 --- /dev/null +++ b/source/images/copilot-agg-pipeline2.png @@ -0,0 +1,47 @@ + + + + + + + + + + + Copilot_user + + diff --git a/source/images/copilot-query.png b/source/images/copilot-query.png index 0f71c356..7c9a83d2 100644 --- a/source/images/copilot-query.png +++ b/source/images/copilot-query.png @@ -4,83 +4,44 @@ - - - - - - - + width="222.09958" + height="44.348175" + x="113.60525" + y="96.418869" + ry="22.174088" /> Copilot_user From 474a0a009c1885a820dcd7fb7887ed93d9b3aaad Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Fri, 27 Sep 2024 09:36:32 -0400 Subject: [PATCH 19/21] DOCSP-43493 Melissa comments --- snooty.toml | 2 +- source/ai-data-usage.txt | 9 +++++---- source/copilot-query.txt | 8 ++++---- source/copilot.txt | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/snooty.toml b/snooty.toml index 566d2c80..da02b2a4 100644 --- a/snooty.toml +++ b/snooty.toml @@ -41,7 +41,7 @@ cifs = ":abbr:`CIFS (Common Internet File System)`" cps = ":abbr:`CPS (Cloud Provider Snapshots)`" cmk = ":abbr:`CMK (customer master key)`" compass = "MongoDB Compass" -copilot = "MongoDB Github Copilot Participant" +copilot = "MongoDB GitHub Copilot Participant" data-lakes = "Data Lakes" data-lake = "Data Lake" datadog = "`Datadog `__" diff --git a/source/ai-data-usage.txt b/source/ai-data-usage.txt index 37625ae6..4b92d342 100644 --- a/source/ai-data-usage.txt +++ b/source/ai-data-usage.txt @@ -9,20 +9,21 @@ AI and Data Usage Information :backlinks: none :depth: 1 -The MongoDB Github Copilot Participant is powered by Generative AI (Gen -AI), and may give inaccurate responses. See our `Generative AI FAQ +The |copilot| is powered by Generative AI (Gen AI), and may give +inaccurate responses. See our `Generative AI FAQ `__ for more information about Gen AI in MongoDB products. Third Party Providers --------------------- -The MongoDB Github Copilot Participant is powered by `Github Copilot `__. +The |copilot| is powered by `GitHub Copilot +`__ and the MongoDB Docs Chatbot. How Your Data is Used --------------------- -When you use the MongoDB Github Copilot Participant, the following +When you use the |copilot| , the following information is sent to MongoDB's backend and/or the third party AI provider: diff --git a/source/copilot-query.txt b/source/copilot-query.txt index f35aa269..bc942045 100644 --- a/source/copilot-query.txt +++ b/source/copilot-query.txt @@ -14,7 +14,7 @@ The ``/query`` command assists in generating queries from a natural language against a connected MongoDB cluster. The |copilot| provides -underlying schema information of the relevant collections to Github +underlying schema information of the relevant collections to GitHub Copilot to generate a response. If you do not specify a collection in your prompt, the chat prompts you to select a relevant collection. @@ -44,7 +44,7 @@ Each document in the collection has the following structure: } Once you connect to the deployment that contains the ``users`` -collection, you can ask the Github Copilot chat to generate a query that +collection, you can ask the GitHub Copilot chat to generate a query that finds the document in the ``users`` collection that has the ``name`` value of ``Kayden Washington``. @@ -54,7 +54,7 @@ value of ``Kayden Washington``. @MongoDB /query In the sample_mflix database, find a document in the users collection with the name of Kayden Washington. -The Github Copilot Chat uses the |copilot| to +The GitHub Copilot Chat uses the |copilot| to generate the following query using knowledge of your database schema: .. code-block:: javascript @@ -90,7 +90,7 @@ Each document in the collection has the following structure: } Once you connect to the deployment that contains the ``users`` -collection, you can ask the Github Copilot chat to generate an aggregation pipeline. +collection, you can ask the GitHub Copilot chat to generate an aggregation pipeline. .. code-block:: javascript :copyable: false diff --git a/source/copilot.txt b/source/copilot.txt index 90659953..76342189 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -12,11 +12,11 @@ :depth: 1 :class: singlecol -|vsce-full| includes the |copilot| to assist in using `Github Copilot +|vsce-full| includes the |copilot| to assist in using `GitHub Copilot `__ with your MongoDB deployments. -Through Github Copilot's chat feature, users with |vsce| can interact +Through GitHub Copilot's chat feature, users with |vsce| can interact with their MongoDB clusters and generate code with MongoDB -domain-specific knowledge on top of Github Copilot's LLM. The |copilot +domain-specific knowledge on top of GitHub Copilot's LLM. The |copilot can also answer questions about your database collection schema and provide links to specific MongoDB documentation. From 624a434af2473807e7e6724a7cc972e5992084c3 Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Fri, 27 Sep 2024 09:42:12 -0400 Subject: [PATCH 20/21] DOCSP-43493 Melissa comments --- source/copilot.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/copilot.txt b/source/copilot.txt index 76342189..986dd512 100644 --- a/source/copilot.txt +++ b/source/copilot.txt @@ -16,7 +16,7 @@ `__ with your MongoDB deployments. Through GitHub Copilot's chat feature, users with |vsce| can interact with their MongoDB clusters and generate code with MongoDB -domain-specific knowledge on top of GitHub Copilot's LLM. The |copilot +domain-specific knowledge on top of GitHub Copilot's LLM. The |copilot| can also answer questions about your database collection schema and provide links to specific MongoDB documentation. From fb9cbe071b39fd78ba1898f0b1217f2ae9b069dc Mon Sep 17 00:00:00 2001 From: Lauren Tran Date: Fri, 27 Sep 2024 09:47:44 -0400 Subject: [PATCH 21/21] DOCSP-43493 Melissa comments --- source/ai-data-usage.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ai-data-usage.txt b/source/ai-data-usage.txt index 4b92d342..ffa58aeb 100644 --- a/source/ai-data-usage.txt +++ b/source/ai-data-usage.txt @@ -18,13 +18,13 @@ Third Party Providers --------------------- The |copilot| is powered by `GitHub Copilot -`__ and the MongoDB Docs Chatbot. +`__. How Your Data is Used --------------------- -When you use the |copilot| , the following -information is sent to MongoDB's backend and/or the third party AI +When you use the |copilot| , the following information is sent to +MongoDB's backend, the MongoDB Docs Chatbot, and/or the third party AI provider: - The full text of your natural language prompt.