Skip to content

Commit 1564785

Browse files
committed
Merge branch 'add-dotnet-solutions' of https://github.com/mongodb-developer/sql-to-query-api-lab into add-dotnet-solutions
2 parents 42cc570 + d313e22 commit 1564785

File tree

21 files changed

+110
-49
lines changed

21 files changed

+110
-49
lines changed

docs/30-quick-start.mdx

Lines changed: 77 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,79 @@
1+
import Tabs from '@theme/Tabs';
2+
import TabItem from '@theme/TabItem';
3+
14
# 👐 Quick Start
25

3-
1. Sign in to Github, and open this repository: [mdb.link/jedee](https://mdb.link/jedee)
4-
2. Click on `Code` > Click on `Codespaces` > Click on `Create a Codespace on Main`
5-
3. ⚠️ **Wait for the Codespace to load completely**
6-
4. Click on the MongoDB extension
7-
5. Click on the `Library DB` in the connections and then select the `library` database
8-
6. Open a playground into the `books` collection
9-
7. Write MongoDB commands in the playground
10-
8. Run MongoDB commands by clicking on the play icon :arrow_forward: at the top right corner
11-
9. Practice by trying out all the examples and exercises mentioned in the next 2 sections: CRUD ops and Aggregation Pipelines.
12-
13-
![Quick start steps 4 to 8](/img/quick-start-steps-4-to-8.png)
6+
:::tip
7+
In this lab, we will be using Jupyter Notebooks, which is an interactive Python environment. If you are new to Jupyter Notebooks, use [this guide](https://mongodb-developer.github.io/vector-search-lab/docs/dev-env/jupyter-notebooks) to familiarize yourself with the environment.
8+
:::
9+
10+
<Tabs groupId="setup options">
11+
<TabItem value="Instruqt" label="Instruqt">
12+
13+
Instruqt is a lab platform that provides cloud-based sandboxes which come pre-configured with all the tools you need to run this lab.
14+
15+
**Navigate to the Instruqt lab using [this link](http://mdb.link/instruqt-jedee).** Fill out the form that appears and click **Submit and access**.
16+
17+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/3-submit-form.png" alt="Submit Instruqt form" />
18+
19+
Click **Start** to launch the lab environment.
20+
21+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/4-start-sandbox-setup.png" alt="Start Instruqt sandbox" />
22+
23+
You should see a screen with a purple progress bar indicating that Instruqt is preparing a sandbox with all the required libraries for this lab and a MongoDB cluster.
24+
25+
Once this is done, you should see a **Start** button at the bottom right of the screen. Click this to enter the lab.
26+
27+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/5-start-lab.png" alt="Start Instruqt lab" />
28+
29+
</TabItem>
30+
31+
<TabItem value="GitHub Codespaces" label="GitHub Codespaces">
32+
33+
1. Sign in to GitHub, and open this repository: [mdb.link/jedee](https://mdb.link/jedee).
34+
2. Click on `Code` > Click on `Codespaces` > Click on `Create a Codespace on Main`.
35+
3. ⚠️ **Wait for the Codespace to load completely.**
36+
37+
![Quick start steps 4 to 8](/img/jedee.png)
38+
39+
</TabItem>
40+
41+
</Tabs>
42+
43+
## Connect to the MongoDB cluster
44+
45+
Let's first connect to the MongoDB database that was created for you. This will allow you to view data we import into the cluster later in the lab, directly from the IDE.
46+
47+
To do this, click the leaf icon in the left navigation bar of the IDE. This is MongoDB's VSCode extension.
48+
49+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/6-click-leaf.png" alt="Click leaf icon" />
50+
51+
Under **Connections**, click the _Local MongoDB Atlas_ connection. This should automatically establish a connection to the local MongoDB cluster running on port 27017.
52+
53+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/7-connect-cluster.png" alt="Connect to the cluster" />
54+
55+
If the connection was successful, you should see a green leaf and a "connected" message appear around the _Local MongoDB Atlas_ connection.
56+
57+
You will also see the default databases in the cluster appear under **Connections**. Any additional databases we create during the lab will also appear here.
58+
59+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/8-connection-successful.png" alt="Connection successful" />
60+
61+
### Jupyter Notebook setup
62+
63+
You will be filling code in a Jupyter Notebook during this lab, so let's get set up with that next!
64+
65+
Within the sandbox, click on the files icon in the left navigation bar of the IDE. In the Explorer menu, navigate to `jedee` > `javascript` > `01_connect_database.ipynb` to open the Jupyter Notebook for this lab.
66+
67+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/2-nav-notebook.png" alt="Navigate to the notebook" />
68+
69+
Next, select the Python interpreter by clicking **Select Kernel** at the top right of the IDE.
70+
71+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/9-select-kernel.png" alt="Select kernel" />
72+
73+
In the modal that appears, click **Python environments...** and select the interpreter that is marked as **Recommended** or **Global Env**.
74+
75+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/10-python-env-modal.png" alt="Select Python Environments" />
76+
77+
<Screenshot url="https://play.instruqt.com" src="img/screenshots/20-dev-env/1-dev-env-setup/instruqt/11-select-recommended.png" alt="Select recommended interpreter" />
78+
79+
That's it! You're ready for the lab!

docs/40-CRUD/1-WHERE.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Now, translate the following into a MongoDB query.
185185
<TabItem value="javascript" label="JavaScript">
186186
<div>
187187
```js
188-
const cursor = await books.find( { "genre.name": "Science", pages: {$gt: 300} } );
188+
const cursor = await books.find( { "genres": "Science", pages: {$gt: 300} } );
189189

190190
await cursor.forEach((b) => {
191191
console.log(b);
@@ -196,7 +196,7 @@ Now, translate the following into a MongoDB query.
196196
<TabItem value="mongosh" label="mongosh">
197197
<div>
198198
```js
199-
db.books.find({ "genre.name": "Science", pages: {$gt: 300} });
199+
db.books.find({ "genres": "Science", pages: {$gt: 300} });
200200
```
201201
</div>
202202
</TabItem>

docs/40-CRUD/2-SELECT.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Here:
5858
## **Example 3: Using projection along with a query**
5959

6060
```js
61-
db.books.find({ "genre.name": "Science" }, { title: 1, totalInventory: 1, _id: 0 });
61+
db.books.find({ "genres": "Science" }, { title: 1, totalInventory: 1, _id: 0 });
6262
```
6363

6464
**Equivalent SQL query:**
@@ -119,7 +119,7 @@ Here:
119119
<TabItem value="javascript" label="JavaScript">
120120
<div>
121121
```js
122-
const cursor = await books.find({ "genre.name": "History" }).project( { _id: 0, authors: 0 } ).limit(10);
122+
const cursor = await books.find({ "genres": "History" }).project( { _id: 0, authors: 0 } ).limit(10);
123123

124124
await cursor.forEach((b) => {
125125
console.log(b);
@@ -130,7 +130,7 @@ Here:
130130
<TabItem value="mongosh" label="mongosh">
131131
<div>
132132
```js
133-
db.books.find({ "genre.name": "History" }, { _id: 0, authors: 0 });
133+
db.books.find({ "genres": "History" }, { _id: 0, authors: 0 });
134134
```
135135
</div>
136136
</TabItem>

docs/40-CRUD/3-ORDER-LIMIT.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This fetches the **5 books with the highest stock**.
4040

4141
```js
4242
db.books
43-
.find({ "genre.name": "Fiction" }, { title: 1, pages: 1 })
43+
.find({ "genres": "Fiction" }, { title: 1, pages: 1 })
4444
.sort({ pages: -1 })
4545
.limit(10);
4646
```

docs/50-aggregation/7-merge.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ The `$merge` stage enables you to store aggregation results into a different col
4747

4848
## **🔹 Example 1: Creating a summary collection**
4949

50-
👉 Suppose we want to generate a collection that contains the **total number of books per genre**.
50+
👉 Suppose we want to generate a collection that contains the **total number of books per genre**. Using mongosh:
5151

5252
```js
5353
db.books.aggregate([
54-
{ $unwind: "$genre" },
55-
{ $group: { _id: "$genre.genreId", totalBooks: { $sum: 1 } } },
54+
{ $unwind: "$genres" },
55+
{ $group: { _id: "$genres", totalBooks: { $sum: 1 } } },
5656
{
5757
$merge: {
5858
into: "genre_summary",

docs/summary.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ sidebar_position: 100
44

55
# 🎯 Summary
66

7-
Congratulations! Following this tutorial, you have successfully learned:
7+
Congratulations! Following this hands-on lab, you have successfully learned:
88

99
- How to query collections in MongoDB
1010
- How to insert, update and delete documents in MongoDB
1111
- How to write aggregation pipelines in MongoDB
1212

13-
Visit the [MongoDB Developer Center](https://mongodb.com/developer/?utm_campaign=devrel&utm_source=workshop&utm_medium=cta&utm_content=sql_to_query_api&utm_term=sourabh_bagrecha) for more useful information and tutorials.
13+
You now have everything you need to earn your <Link to="https://learn.mongodb.com/courses/crud-operations-in-mongodb?team=devrel&">CRUD Operations MongoDB Skill Badge</Link> — an official recognition of your MongoDB knowledge. Claim your badge for free and proudly display it on your LinkedIn profile under **Licenses & Certifications**!
14+
15+
<Screenshot src="img/badge.png" url="https://linkedin.com"></Screenshot>
16+
17+
Explore all free <Link to="https://learn.mongodb.com/skills?team=devrel&">MongoDB Skill Badges</Link> and level up your skills today!

docusaurus.config.js

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,20 @@ const utmParams = `utm_campaign=devrel&utm_source=workshop&utm_medium=cta&utm_co
5151

5252
const footerLinks = [
5353
{
54-
label: "Try MongoDB Atlas",
54+
label: 'Try MongoDB Atlas',
5555
href: `https://www.mongodb.com/try?${utmParams}`,
56-
},
57-
{
58-
label: "Forums",
59-
href: `https://www.mongodb.com/community/forums/?${utmParams}`,
60-
},
61-
{
62-
label: "Developer Center",
63-
href: `https://www.mongodb.com/developer/?${utmParams}`,
64-
},
65-
{
66-
label: "MongoDB University",
67-
href: `https://learn.mongodb.com/?${utmParams}`,
68-
},
69-
{
56+
}, {
57+
label: 'Forums',
58+
href: `https://www.mongodb.com/community/forums?${utmParams}`,
59+
}, {
60+
label: 'Skill Badges',
61+
href: `https://learn.mongodb.com/skills?team=devrel&${utmParams}`,
62+
}, {
7063
href: `https://github.com/${organizationName}/${workshopName}`,
71-
label: "This lab in GitHub",
64+
label: "This lab in GitHub"
65+
}, {
66+
label: ${new Date().getFullYear()} MongoDB, Inc.`,
67+
href: "#",
7268
},
7369
];
7470

@@ -151,8 +147,7 @@ const config = {
151147
},
152148
footer: {
153149
style: "dark",
154-
links: footerLinks,
155-
copyright: ${new Date().getFullYear()} MongoDB, Inc.`,
150+
links: footerLinks
156151
},
157152
prism: {
158153
theme: lightCodeTheme,

i18n/es/docusaurus-plugin-content-docs/current/40-structure-site/1-docusaurus-config.mdx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const featureList = [
4747

4848
// UTM stuff
4949

50-
const utmAdvocateName = `diego.freniche`;
51-
const utmWorkshopName = 'docusaurus_workshop'
50+
const utmAdvocateName = 'sourabh.bagrecha';
51+
const utmWorkshopName = 'sql.query.api';
5252

5353
const utmParams = `utm_campaign=devrel&utm_source=workshop&utm_medium=cta&utm_content=${utmWorkshopName}&utm_term=${utmAdvocateName}`;
5454

@@ -61,15 +61,11 @@ const footerLinks = [
6161
},
6262
{
6363
label: 'Forums',
64-
href: `https://www.mongodb.com/community/forums/${utmParams}`,
64+
href: `https://www.mongodb.com/community/forums?${utmParams}`,
6565
},
6666
{
67-
label: 'Developer Center',
68-
href: `https://www.mongodb.com/developer/${utmParams}`,
69-
},
70-
{
71-
label: 'MongoDB University',
72-
href: `https://learn.mongodb.com/${utmParams}`,
67+
label: 'Skill Badges',
68+
href: `https://learn.mongodb.com/skills?team=devrel&${utmParams}`,
7369
},
7470
{
7571
label: `© ${new Date().getFullYear()} MongoDB, Inc.`,

static/img/badge.png

19.4 KB
Loading

static/img/jedee.png

171 KB
Loading

0 commit comments

Comments
 (0)