You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/20-dev-env/2-dev-env-setup.mdx
+26-23Lines changed: 26 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -8,50 +8,53 @@ In this lab, we will be using Jupyter Notebooks, which is an interactive Python
8
8
9
9
## Option 1: GitHub Codespaces
10
10
11
-
You will be working in a Jupyter Notebook in a GitHub Codespace throughout this lab. A codespace is a cloud-hosted, containerized development environment that comes pre-configured with all the tools you need to run this lab.
11
+
You will be working in GitHub Codespaces throughout this lab. A codespace is a cloud-hosted, containerized development environment that comes pre-configured with all the tools you need to run this lab.
12
12
13
13
Navigate to [this](https://github.com/codespaces/new/mongodb-developer/genai-devday-notebooks?quickstart=1) link. You will be prompted to sign into GitHub if you haven't already. Once signed in, click the **Create new codespace** button to create a new codespace.
14
14
15
15
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/20-dev-env/2-dev-env-setup/1-create-codespace.png"alt="Start a codespace" />
16
16
17
-
Let it run for a few seconds as it prepares a Docker container with all the required libraries and a MongoDB cluster. Once the environment is built, you should see a VS Code IDE with a list of files under the Explorer tab.
17
+
Let it run for a few seconds as it prepares a Docker container with all the required libraries and a MongoDB cluster.
18
18
19
-
In the Explorer menu, under `notebooks`, click on the file named `vector-search-lab.ipynb`to open the Jupyter Notebook for this lab.
19
+
### Connect to the MongoDB cluster
20
20
21
-
<Screenshoturl="https://github.com/codespaces"src="img/screenshots/20-dev-env/2-dev-env-setup/2-nav-notebook.png"alt="Navigate to the notebook" />
21
+
Once the environment is built, you will be prompted to connect to the MongoDB cluster via MongoDB's VSCode extension. This will allow you to visualize the data that we will import into the cluster later in the lab, directly from the VSCode IDE.
22
22
23
-
Next, select the Python interpreter by clicking **Select Kernel**at the top right of the IDE.
23
+
To connect to the cluster, click the **Connect**button.
You can view the default and any additional collections we create on the cluster during the lab by clicking the leaf icon in the left navigation bar of the IDE.
34
36
35
-
<details>
36
-
<summary>🦹 Use the MongoDB for VS Code extension to interact with the local MongoDB cluster from the VSCode IDE. </summary>
You will be filling code in a Jupyter Notebook during this lab, so let's get set up with that next!
41
42
42
-
In the tab that appears, click the **Connect** button.
43
+
Click on the files icon in the left navigation bar. In the Explorer menu, under `notebooks`, click on the file named `vector-search-lab.ipynb` to open the Jupyter Notebook for this lab.
In the modal that appears, click **Python environments...** and select the interpreter that is marked as **Recommended** or **Global Env**.
49
52
50
-
If the connection was successful, you should see the cluster and its default databases under Connections. Any additional databases and collections created during the lab will appear here as well.
<summary>🦹 Visually verify that embeddings have been added to the documents in the `books` collection. </summary>
65
-
66
-
Click on the leaf icon in the left navigation bar of the IDE.
63
+
To visually verify that embeddings have been added to the documents in the `books` collection, click on the leaf icon in the left navigation bar of the IDE.
67
64
68
-
Navigate to a document in the _books_ collection and ensure that it has an `embedding` field.
65
+
Navigate to a document in the _books_ collection and ensure that it has an `embedding` field.
Copy file name to clipboardExpand all lines: docs/40-perform-vector-search/3-create-vector-index.mdx
+1-16Lines changed: 1 addition & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,4 @@
2
2
3
3
To retrieve documents from MongoDB using vector search, you must configure a vector search index on the collection into which you ingested your data. In this lab, you will programmatically create vector search indexes using MongoDB's Python driver.
4
4
5
-
Fill in any `<CODE_BLOCK_N>` placeholders and run the cells under the **Step 5: Create a vector search index** section in the notebook to create a vector search index on the `books` collection.
6
-
7
-
The answers for code blocks in this section are as follows:
8
-
9
-
**CODE_BLOCK_6**
10
-
11
-
<details>
12
-
<summary>Answer</summary>
13
-
<div>
14
-
15
-
```python
16
-
collection.create_search_index(model=model)
17
-
```
18
-
19
-
</div>
20
-
</details>
5
+
Run the cells under the **Step 5: Create a vector search index** section in the notebook to create a vector search index on the `books` collection.
0 commit comments